xpdo 2.5.3-pl not working $query->groupby() #13287

andchir opened this Issue Feb 10, 2017 · 8 comments


None yet

4 participants

andchir commented Feb 10, 2017


xpdo 2.5.3-pl not working $query->groupby().

Step to reproduce

Make query with $query->groupby() no results.


modx 2.5.1pl, xpdo 2.5.3-pl

Mark-H commented Feb 10, 2017

MODX 2.5.1? Update immediately, you're vulnerable to some serious issues.

Also if this is the bug I think it is (hard to tell if you don't provide at the very least the query you're building) that would also be resolved in 2.5.4+.

andchir commented Feb 10, 2017 edited

Thank you for your answer. I updated to MODX 2.5.5. But the problem with $query->groupby() is not solved.


@andchir Can you provide the actual code that does not work?

andchir commented Feb 10, 2017 edited


$query = $modx->newQuery('modResource');

$collection = $modx->getCollection('modResource', $query);

var_dump( count( $collection ) );//Output: int(0)

If I remove $query->groupby('parent'); - output: int(36)

andchir commented Feb 10, 2017 edited

Maybe this is my local MySQL settings. I have message:

SELECT list is not in GROUP BY clause and contains nonaggregated column 'modx.modResource.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

MySQL version: 5.7.17

Jako commented Feb 10, 2017

You have some STRICT checks enabled in the MySQL/MariaDB configuration.


Does this help?

andchir commented Feb 10, 2017

I disabled the setting "only_full_group_by" and it solved the problem.
You can close this task. Thank you all.


@andchir Reason @Jako asked this is to fix the issue for future incidents. Think we better leave this open until we have fixed this with only_full_group_by turned on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment