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

Exporting contributions does not export all found records due to erroneous group by statement

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.4.5
    • Fix Version/s: 3.4.6
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      When attempting to export contributions not all records are exported. For example, you may search for all contributions received this year and the interface tells yous that there are 1,803 records. When exporting, the CSV file contains many less records than the number indicated. Since I don't fully understand all the new code relating to exporting records I'll give an idea of where the problem may lay and leave it to a developer more familiar with the code to actually implement a fix. The following flow, of course, is only relative to my contribution search and particular parameters, so many not apply in every case, but at least in some:

      In CRM/Contact/BAO/Query.php on line 3424 $this->_useDistinct is set to true in the function searchQuery(). From inside searchQuery() the function query() is called, and on line 1115 if _useDistinct is set (along with another parameter) then $this->_useGroupBy gets set to true. The problem is apparently the GROUP BY statement getting added to the query. This causes problems in the output because we have many users who contribute many times in a year (recurring), so grouping on contact ID seems to be removing all contributions from the same person, except for 1, of course.

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              nkinkade Nathan Kinkade
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: