MetaModels / core

MetaModels Core Module
GNU Lesser General Public License v3.0
96 stars 42 forks source link

count is incompatible with sql_mode only_full_group_by #1423

Closed magicsepp closed 3 years ago

magicsepp commented 4 years ago

Checklist before I submit this issue report

I confirm that:

My environment is:

(Please fill in the actual values from your environment - check Contao Manager or use composer show)

Key Value Comments
PHP version: PHP Version 7.2.19
Contao version: 4.4.51
MetaModels version: 2.1.[1-9]
Installed MetaModels packages: core 2.1.9 MM2.1
DCG version: 2.1.8

Issue description

after update core to 2.1.10 the BE tables are not accessable by error f.e.

An exception occurred while executing 
'SELECT sauna, COUNT(sauna) as mm_count FROM mm_sauna WHERE id IN (?, ?) GROUP BY sauna ORDER BY FIELD(id, ?, ?) ASC'
 with params ["160", "29", "160", "29"]:
SQLSTATE[42000]: Syntax error or access violation:
1055 Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column
'cto44.mm_sauna.id' which is not functionally dependent on columns in GROUP BY clause;
this is incompatible with sql_mode=only_full_group_by

Steps to reproduce

  1. update core to 2.1.10
  2. klick a mm_table
  3. internal error see above

Describe the behaviour of the application

(Tell us what happens)

Describe the expected behaviour of the application

a list of data as defined

Screenshots

(Add some visual love or even a video if you can) I guess there is no need ;)

zonky2 commented 4 years ago

@discordier related with https://github.com/MetaModels/core/pull/1419

magicsepp commented 3 years ago

same result with core 2.1.10,

zonky2 commented 3 years ago

same result with core 2.1.10,

please note the indicated milestone

zonky2 commented 3 years ago

fixed in MM 2.2