CRM-21029 Activity report SQL syntax error

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.7.23
    • Fix Version/s: 4.7.24
    • Component/s: CiviReport
    • Labels:
    • Versioning Impact:
      None (no code merged)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding
    • Verified?:
      No

      Description

      After installing 4.7.23, the "Scheduled Activities" dashlet causes a "Network Error : unable to reach the server" popup, and the dashlet does not populate.

      Looks like there is an error in the SQL statement around line 870 of Report/Form/Activity.php.

      When "$this->_aclWhere" is NULL, the WHERE statement resolves as WHERE (1) AND GROUP BY, which throws a syntax error.

      I fixed it by adding an IF clause to ensure that the AND isn't included if "$this->_aclWhere" is empty.

        Attachments

          Activity

          [CRM-21029] Activity report SQL syntax error
          Joe Murray added a comment -

          @monish could you fix this apparent regression. The problem of WHERE (1) AND GROUP BY seems like a pattern I've seen before ... please make fix as general as possible, or use pattern for fix from elsewhere in codebase if appropriate, or just review and merge. 

            People

            • Assignee:
              Monish Deb
              Reporter:
              Jeremy Nicholls

              Dates

              • Created:
                Updated: