terminal42 / contao-conditionalformfields

Display form fields conditionally in Contao Open Source CMS
MIT License
18 stars 13 forks source link

V3 not working in Contao 4.9.30+ #60

Closed denniserdmann closed 1 year ago

denniserdmann commented 2 years ago

Contao: fresh 4.9.31 installation conditionalformfields: 3.0.5 additional extensions: only mp_forms

After adding a checkbox foo and activating a condition foo == '1' inside the fieldset, the backend results in an error 500.

Error-Log:

Tue Jul 05 11:56:54.292690 2022] [php7:error] [pid 29540] [client ::1:60306] PHP Fatal error:  Allowed memory size of 4294967296 bytes exhausted (tried to allocate 65536 bytes) in /project/vendor/symfony/error-handler/DebugClassLoader.php on line 349, referer: http://xyz.localhost/
zonky2 commented 2 years ago

I have the same error with version 3.*

I also have mp_forms in the form, but I'm not sure if it's because of the extension.

For the test I only had the fieldset active - there I also got a 500.

after a downgrade to 2.* it ran again

In the log file:

[2022-06-30 15:15:21] request.CRITICAL: Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\OutOfMemoryError: "Error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 122880 bytes)" at /html/xyz/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php line 141 {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\OutOfMemoryError(code: 0): Error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 122880 bytes) at /html/xyz/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:141)"} []
...
[2022-07-01 09:44:03] request.CRITICAL: Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\OutOfMemoryError: "Error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 122880 bytes)" at /html/xyz/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php line 141 {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\OutOfMemoryError(code: 0): Error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 122880 bytes) at /html/xyz/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:141)"} []
lplusl commented 2 years ago

Same "500" problem here. Additionally, after downgrading to 2.3.4 we lost the condition functionality – all fieldsets visible now. They had worked properly before we updated the extension to v3 and core to 4.9.30. Help much appreciated.

EDIT: It seems like the syntax of the conditions has changed. In v2, a leading "dollar" was required, which is abandoned in v3. The update from v2 to v3 seems to have changed the values in the database (dollar removed). Is this done by the extension? Downgrading to v2 now results in invalid syntax = all fieldsets visible.

aschempp commented 2 years ago

yes, syntax has changed (the $ is removed) and there is an automatic migration for existing conditions

zonky2 commented 2 years ago

yes, syntax has changed (the $ is removed) and there is an automatic migration for existing conditions

see https://github.com/terminal42/contao-conditionalformfields/pull/61

lplusl commented 2 years ago

yes, syntax has changed (the $ is removed) and there is an automatic migration for existing conditions

Thank you for confirming. Will the Error 500 issue be addressed? We can't use v3 for that and v2 conditions have been rendered invalid due to automatic migration by update to v3. 500 bugfix highly appreciated.

aschempp commented 1 year ago

I have analyzed the issue and it is an endless recursion when using mp_forms. https://github.com/terminal42/contao-mp_forms/pull/62 needs to be merged to fix the problem.

aschempp commented 1 year ago

fixed in bab96ee6a095462099649f2aac5eb784883656b5 and released as 3.0.6