CRM-15482 Contribution Details report fails when Soft Credits are selected and ACLs are enabled

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.7, 4.5.2
    • Fix Version/s: 4.5.3
    • Component/s: CiviContribute, CiviReport
    • Labels:
      None
    • Documentation Required?:
      None

      Description

      It's a bit tricky to replicate - you need to have a user who can't view all contacts, which generates an ACL clause in the report. The ACL clause is generated in the wrong part of the SQL. It's a simple fix, I've got a patch ready to submit.

        Attachments

          Activity

          [CRM-15482] Contribution Details report fails when Soft Credits are selected and ACLs are enabled
          Jon K Goldberg added a comment -

          For folks searching to find this error: You get a "DB Error: syntax error" if you don't have "View All Contacts" permission and you try to run the Contribution Details report while showing soft credits. If you turn on debugging, you'll get this SQL error:
          [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON contact_civireport.id = contribution_soft_civireport.contact_id

          Yashodha Chaku added a comment -

          Jon: It looks like your PR is against master(4.6).
          Can you please submit a PR against 4.5 instead for the same?

          Jon K Goldberg added a comment -

          Hi Yashodha,

          The file is unchanged between 4.5 and master, but I submitted a new PR: https://github.com/civicrm/civicrm-core/pull/4423

          David Greenberg added a comment -

          Recreated bug and tested patch against the case. Also tested a few queries w/o ACLs. Looks good.

            People

            • Assignee:
              David Greenberg
              Reporter:
              Jon K Goldberg

              Dates

              • Created:
                Updated:
                Resolved: