terminal42 / contao-mp_forms

Real step separation in the form generator of the Contao Open Source CMS
25 stars 13 forks source link

Upgrade-Hinweis von Version 4 auf 5 ergänzen #73

Closed denniserdmann closed 1 year ago

denniserdmann commented 1 year ago

Moin!

Mir ist aufgefallen, dass beim Upgrade von Version 4 auf 5 bei den Inserttags nicht mehr der ID-Name zugelassen ist.

Vorher: {{mp_forms::calculator::step::current}}

wobei calculator die ID des Formulars ist. Das Ergebnis:

Uncaught PHP Exception InvalidArgumentException: "Could not load form ID "0"." at /html/contao/vendor/terminal42/contao-mp_forms/src/FormManager.php line 377 {"exception":"[object] (InvalidArgumentException(code: 0): Could not load form ID \"0\". at /html/contao/vendor/terminal42/contao-mp_forms/src/FormManager.php:377)"} []

In Version 5: {{mp_forms::5::step::current}}

Vielleicht könnt ihr noch einen Hinweis in die UPGRADE.md aufnehmen oder die Verwendung des ID-Feldes wieder berücksichtigen.

Toflar commented 1 year ago

I'm sorry but I don't think that's true? This is the first time I read about this. The latest commit before I released v5 was cd2ea243af697833def645aee153b25fd81e3957. And the corresponding source code is here: https://github.com/terminal42/contao-mp_forms/blob/cd2ea243af697833def645aee153b25fd81e3957/MPForms.php#L175-L180

So it's passed directly to findByPk(). calculator would've never worked, would it?

denniserdmann commented 1 year ago

It worked in Version 4. I had 2 forms (de/en), both with a CSS-ID calculator and both showed the current step. But as i had only 2 steps i could have been „luck“.

Toflar commented 1 year ago

It was at least never an officially supported use case so I'll close this issue :)