Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fatal error when full group by mysql mode enabled & selecting contacts #14331

Merged
merged 1 commit into from
May 26, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Fixes a fatal error under some circumstances.

To replicate - on a server with full group by mysql mode enabled do a contact search. Select a contact & click next

Before

Screen Shot 2019-05-25 at 8 34 40 PM

After

No fatal

Technical Details

Disable full group by when selecting contacts. Per the screen shot the query is pretty non-std & it makes sense fgb mode rejects it - this is our std solution

Comments

@civibot
Copy link

civibot bot commented May 25, 2019

(Standard links)

@civibot civibot bot added the master label May 25, 2019
@@ -4971,7 +4972,9 @@ public function getCachedContacts($cids, $includeContactIds) {
$limit = '';
$query = "$select $from $where $groupBy $order $limit";

return CRM_Core_DAO::executeQuery($query);
$result = CRM_Core_DAO::executeQuery($query);
CRM_Core_DAO::disableFullGroupByMode();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't look right @eileenmcnaughton

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erm yep, fixed

@seamuslee001
Copy link
Contributor

Jenkins re test this please

eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request May 26, 2019
@eileenmcnaughton
Copy link
Contributor Author

Unit test added here #14340

seamuslee001 added a commit that referenced this pull request May 26, 2019
@seamuslee001
Copy link
Contributor

Jenkins re test this please

@eileenmcnaughton eileenmcnaughton merged commit d4d1ab5 into civicrm:master May 26, 2019
@eileenmcnaughton eileenmcnaughton deleted the select branch May 26, 2019 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants