CRM-14113 Activity Search Builder

    Details

    • Type: Patch
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.1
    • Fix Version/s: 4.4.5
    • Component/s: None
    • Labels:
      None

      Description

      The Activity Search Builder was constructing an invalid MySQL query. Patch provides fix.

        Attachments

          Activity

          [CRM-14113] Activity Search Builder
          Pradeep Nayak added a comment -

          Submitted PR at https://github.com/civicrm/civicrm-core/pull/2561

          To replicate

          1. Navigate to Search -> Search Builder
          2. Add filter as Activity Status IN Completed, Schedule.

          David Greenberg added a comment -

          The patch works as expected.

          However in testing I noticed that Activity Type search wasn't working at all (which seems like an important related use case for anyone who is searching on activity status). I was able to come up with a partial 'hack' fix:

          1. add 'activity_type' to switch statement around line 1628 in CRM/Contact/BAO/Query.php (after activity_type_id)

          2. change 'activity_type_id' to 'activity_type' in CRM/Activity/BAO/Query.php line 190 (not sure if we need both activity_type and activity_type_id case statements here ??)

          With these 2 changes you can Search by Activity => Activity Type = 'Meeting' (for example).

          However, QUILL uses the ID instead of label ("Activity Type '1'"), AND if you use the "IN" operator it throws MySQL error on activity_type, which I think is a similar issue. I'm hoping you can pretty quickly come up with the right fix for that as well so we can have both filters working properly. If it's not a quick fix, we'll just merge in the activity_status fix for now.

          Joe Murray added a comment -

          Thanks for digging in to this Dave. Since you've pushed things forward on that other bug we'll finish up that fix. There are lots of other bugs in the Search Builder as you likely know, but we're not going to address them right now.

          David Greenberg added a comment -

          Works great for activity type and status!

            People

            • Assignee:
              David Greenberg
              Reporter:
              Joe Murray

              Dates

              • Created:
                Updated:
                Resolved: