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

Undefined variable: order in CRM_Contact_BAO_Query->prepareOrderBy()

    Details

    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      Drupal 7.43
      CiviCRM 4.6.17
      PHP 5.5.36

      For me several user accounts in Drupal are linked to contact records in Civi, and in the standard way where you see the linked contact details on the (eg) "user/1" page.

      On login, or viewing another user in Drupal the following 3 notice errors are fired now after yesterday's upgrade from 4.6.16 to 4.6.17:

      Notice: Undefined variable: order in CRM_Contact_BAO_Query->prepareOrderBy() (line 5846 of /home/.../public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php).
      Notice: Undefined variable: order in CRM_Contact_BAO_Query->prepareOrderBy() (line 5886 of /home/.../public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php).
      Notice: Undefined variable: order in CRM_Contact_BAO_Query->prepareOrderBy() (line 5890 of /home/.../public_html/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php).

      We fix this by adding "$order = NULL;" at the top of function prepareOrderBy() in /sites/all/modules/civicrm/CRM/Contact/BAO/Query.php

        protected function prepareOrderBy($sort, $sortByChar, $sortOrder, $additionalFromClause) {
          $order = NULL;      
          $config = CRM_Core_Config::singleton();
          .......
      

      Happy to PR but I'm on 4.6.17 not 4.7.x

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rollox Will Mowlam
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: