Sterc / FormIt

A dynamic form processing Snippet for MODX Revolution
https://docs.modx.com/current/en/extras/formit
33 stars 58 forks source link

FormItSaveForm ERROR: Filter by form name and encrypted forms component causing SQL error #293

Open travisbotello opened 3 months ago

travisbotello commented 3 months ago

Bug report

Summary

Filter by form name and encrypted forms tabs are empty.

Step to reproduce

Submit a form using FormItSaveForm hook

Observed behavior

When checking the submitted forms in formit CMP the form name filter select box is empty + encrypted forms tab is empty. MODX error log reporting the following SQL error:

core/xpdo/om/xpdoobject.class.php : 240) Error 42000 executing statement: 
Array
(
    [0] => 42000
    [1] => 1055
    [2] => Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'modx_event.FormItForm.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
)

Expected behavior

Filter by from name and encrypted form tab should be working.

Environment

MODX 2.8.7 + FormIt 4.2.7 PHP 8.2 + MySQL 8

halftrainedharry commented 3 months ago

I created pull requests to fix the issue for the two MODX branches. This error only occurs if the sql_mode "ONLY_FULL_GROUP_BY" is used. sql_mode can be changed in the MySQL configuration file "my.ini". See also the related issue #178.