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

Using IS EMPTY operator for some date fields crashes 4.7.7

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7.7
    • Fix Version/s: 4.7.9
    • Component/s: CiviCRM Search
    • Labels:
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      This defect is reproducible on the 4.7 Drupal7 demo site.

      1. With Search Builder, search for 'Individual > Deceased Date > Is Empty
      2. CiviCRM crashes with a database error

      The database error is a syntax exception. MySQL complains about the clause 'contact_a.deceased_date IS EMPTY'.

      Reviewing the code for CRM_Contact_BAO_Query I see that IS EMPTY needs to be translated into 'IS NULL' or "equals the empty string".

      The code for CRM_Contact_BAO_Query::dateQueryBuilder() doesn't do this.

      PR incoming.

        Attachments

          Activity

            People

            • Assignee:
              yashodha Yashodha Chaku
              Reporter:
              ken Ken West
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: