nao-pon/xelfinder

MySQL 5.7 における group by

kilica opened this issue · 2 comments

すみません、報告のみとなりますが、 MySQL の sql_mod に ONLY_FULL_GROUP_BY が設定されている場合(5.7よりデフォルトで設定)、サーバブラウザを開いたときにエラーになります。

connector.php の Response:
{"error":["errConf","errNoVolumes"],"debug":["Driver \"elFinderVolumeXoopsXelfinder_db\" : Expression #17 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'angelland_xoops.ch.file_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by. Duplicate entry '0-VolumeRoot' for key 'parent_name'. Expression #17 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'angelland_xoops.ch.file_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by. Root folder does not exists."]}

参考

こんな感じで修正しますと、とりあえず動作します。

/xoops_trust_path/modules/xelfinder/plugins/xelfinder_db/driver.class.php

730行目
GROUP BY f.file_id, f.parent_id, f.name, f.size, f.mtime, f.mime, f.perm, f.umask, f.uid, f.gid, f.home_of, f.width, f.height, f.gids, f.mime_filter, f.local_path, ch.file_id';

1047行目
GROUP BY f.file_id, f.parent_id, f.name, f.size, f.mtime, f.mime, f.perm, f.umask, f.uid, f.gid, f.home_of, f.width, f.height, f.gids, f.mime_filter, f.local_path, ch.file_id';

@kilica アドバイスありがとうございます!検証して修正します。 👍