Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Critical
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7.12, 4.7.13, 4.7.14, 4.7.15
-
Fix Version/s: 4.7.25
-
Component/s: Core CiviCRM, NYSS
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Core Team Contract
-
Verified?:No
Description
See http://civicrm.stackexchange.com/questions/16613/civi-does-not-email-to-some-contacts-not-civimail-just-mail for an introduction...
CRM_Contact_BAO_Query::apiQuery() returns wrong rows if
- parameter $rowCount is passed
- $query's group_by isn't set and
- contacts hold more than on email addresses.
In this case dao returns multiple rows for one contact and the sql limit by $rowCount will lead to missing items.
Core folks, where to set $_useGroupBy = true? I'm confused because you call the static function apiQuery by instance $query in CRM_Utils_Toke.php. The static function itself creates an object of it's class. But because signature lacks a groupBy flag I don't know if it's save to tell the query to group by. Should it always group by here?
Jesus! What a rant.
Proposed fix: https://github.com/civicrm/civicrm-core/pull/9676 or maybe better addressed by https://github.com/civicrm/civicrm-core/pull/10915 by Eileen McNaughton
Attachments
Issue Links
- links to