Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-17252

Advanced Search by Group broken

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Blocker
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7
    • Fix Version/s: 4.7
    • Component/s: None
    • Labels:
    • Documentation Required?:
      None
    • Funding Source:
      Core Team Funds

      Description

      Currently, searching by Group (regular or 'smart' group) from Advanced Search throws a fatal DB query error:
      Database Error Code: Unknown column 'Array' in 'where clause', 1054
      SELECT DISTINCT UPPER(LEFT(contact_a.sort_name, 1)) as sort_name FROM civicrm_contact contact_a LEFT JOIN civicrm_group_contact `civicrm_group_contact-Array` ON (contact_a.id = `civicrm_group_contact-Array`.contact_id AND `civicrm_group_contact-Array`.status IN ("Added")) LEFT JOIN civicrm_group_contact_cache `civicrm_group_contact_cache_Array` ON contact_a.id = `civicrm_group_contact_cache_Array`.contact_id WHERE ( ( ( `civicrm_group_contact-Array`.group_id = Array ) OR ( `civicrm_group_contact_cache_Array`.group_id IN ("") ) ) ) AND (contact_a.is_deleted = 0) ORDER BY UPPER(LEFT(contact_a.sort_name, 1)) asc [nativecode=1054 ** Unknown column 'Array' in 'where clause']

      ==============================

      ===============================
      On next page load, these notices appear
      ===============================
      Notice: Array to string conversion in CRM_Contact_BAO_Query->addGroupContactCache() (line 2926 of /Users/dgg/git/crm_v4.7/CRM/Contact/BAO/Query.php).
      Notice: Array to string conversion in CRM_Contact_BAO_Query->group() (line 2830 of /Users/dgg/git/crm_v4.7/CRM/Contact/BAO/Query.php).

      ==============
      Also seeing this warning after saving a smart group and after using a smart group from Find Contacts to search on:
      Strict warning: Declaration of CRM_Contact_BAO_SavedSearch::save() should be compatible with CRM_Core_DAO::save($hook = true) in require_once() (line 37 of /Users/dgg/git/crm_v4.7/CRM/Contact/BAO/SavedSearch.php).

      — Original Post —
      I'm not sure if this is worth logging as I think it is already represented by test breakage - but at the moment on dmaster if I do the following I get a mysql error

      1) create a smart group for all individuals
      2) advanced search & add that group into the criteria (include group)
      3) hit search

      If you can follow these steps without hitting this error then close as it may be resolved in conjunction with getting the tests passing by the time anyone looks at it.

        Attachments

          Activity

            People

            • Assignee:
              monish.deb Monish Deb
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: