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

processGreetings: error running query on same object

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.3
    • Fix Version/s: 4.4.4
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      in CRM_Contact_BAO_Contact::processGreetings() –
      there is a recently added line we run $contact->find(TRUE). according to the comments, this was done to ensure the necessary fields have been retrieved in order to process greetings successfully.

      however, while this may work when the method is run via the interface, it may break in other contexts, such as bulk greeting updates. the issue is that it assumes the $contact object was not constructed via a query. PEAR DB_DataObject doesn't let you do two queries on the same object. so if the processGreetings method was passed a $contact object derived from a query (as is the case with bulk update), this errors.

      we simply need to condition that method call on the existence of a query (as PEAR itself does when throwing the "two queries" error).

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              lcdweb Brian Shaughnessy
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: