terminal42 / contao-conditionalformfields

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

Again Error with contao-mp_forms #75

Closed FlorinvV closed 1 year ago

FlorinvV commented 1 year ago

Hey guys,

this may be a continuation of this issue from the last weeks.

Same procedure as last time, but this time with another error:

[2023-02-20T08:02:02.151707+01:00] request.INFO: Matched route "tl_page.3.root". {"route":"tl_page.3.root","route_parameters":{"_token_check":true,"_controller":"Contao\\FrontendIndex::renderPage","_scope":"frontend","_locale":"de","_format":"html","_canonical_route":"tl_page.3","parameters":"","pageModel":{"Contao\\PageModel":[]},"_route":"tl_page.3.root","_route_object":{"Symfony\\Component\\Routing\\Route":[]}},"request_uri":"https://contaotest.mees-zacke.de/preview.php/","method":"GET"} []
[2023-02-20T08:02:02.155845+01:00] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
[2023-02-20T08:02:02.171438+01:00] request.CRITICAL: Uncaught PHP Exception Error: "Cannot use object of type Terminal42\MultipageFormsBundle\Step\StepDataCollection as array" at /www/htdocs/w0070178/contaotest.mees-zacke.de/vendor/terminal42/contao-conditionalformfields/src/FormHandler.php line 173 {"exception":"[object] (Error(code: 0): Cannot use object of type Terminal42\\MultipageFormsBundle\\Step\\StepDataCollection as array at /www/htdocs/w0070178/contaotest.mees-zacke.de/vendor/terminal42/contao-conditionalformfields/src/FormHandler.php:173)"} []

What is different this time, is that it always occurs, even if mp_forms is just installed, not only if both conditionalformfields and mp_forms are used in one form.

Again, this occurs in completely new forms as well as already existing ones and in different contao-systems on different servers

Tested with Contao 4.13.15, conditionalformfields 3.0.9, mp_forms 5.0.1, PHP 8.1.13

FlorinvV commented 1 year ago

Are there any updates to this? Or may I the only one having this problem?

I'm happy to help solving this problem, if I somehow can.

fritzmg commented 1 year ago

I am not sure, but I think

https://github.com/terminal42/contao-conditionalformfields/blob/a7ab24a97bbf6690d1f3d40b745226fbf13f4ae9/src/FormHandler.php#L173

needs to be changed to

return $previousStepsData->getAllSubmitted();
southanx commented 1 year ago

Das löst mein Problem wie oben beschrieben, Danke!