ryanhowdy / fcms

Family Connections - Create a private family website.
http://www.familycms.com
GNU General Public License v2.0
84 stars 41 forks source link

MySQL : incompatible mode (only_full_group_by) #567

Open ryanhowdy opened 6 years ago

ryanhowdy commented 6 years ago

Assigned to Problems, Issues and Bugs #19463. As reported in Tender:

Hi,

i had to change my new VPS server,
and so after move te the new one and imported the DB and "familycms web files",
i get this error :
----------------------------------------------------------------

Cannot execute SQL statement.

Array ( [0] => 42000 [1] => 1055 [2] => Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'sub.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by )

File: /var/www/html/FamDias/inc/Database.php

Line: 307

SQL:
SELECT * FROM ( SELECT p.`id`, p.`date`, p.`filename`, c.`name`, p.`user`, p.`category`, e.`thumbnail`, p.`external_id` FROM `fcms_gallery_photos` AS p LEFT JOIN `fcms_category` AS c ON p.`category` = c.`id` LEFT JOIN `fcms_gallery_external_photo` AS e ON p.`external_id` = e.`id` ORDER BY `date` DESC ) AS sub GROUP BY `category` ORDER BY `date` DESC LIMIT 0, 10

Stack:
#0 __construct called at [/var/www/html/FamDias/admin/gallery.php:27]
#1 control called at [/var/www/html/FamDias/admin/gallery.php:61]
#2 displayLatestCategoriesForm called at [/var/www/html/FamDias/admin/gallery.php:108]
#3 getRows called at [/var/www/html/FamDias/admin/gallery.php:207]
#4 add called at [/var/www/html/FamDias/inc/Database.php:308]

----------------------------------------------------------------

Im running this in :
Ubuntu 16.04.1
mysql Ver 14.14 Distrib 5.7.22
PHP: 7.0.30-0
FC 3.7.0

Its suposed to be resolved with something like this:
https://stackoverflow.com/questions/36207042/error-code-1055-incompatible-with-sql-mode-only-full-group-by

i just think its a strange way to resolved in this way, because its suposed not being need to do anything of this kind, i think...

Any advice, pls ?