terminal42 / contao-mp_forms

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

Typo in release note #54

Closed ameotoko closed 1 year ago

ameotoko commented 2 years ago

This is not a bug, just a note regarding this announcement: https://github.com/terminal42/contao-mp_forms/releases/tag/4.2.0

form_mp_form_page_switch should be form_mp_form_pageswitch, because customTpl infers template names from $GLOBALS['TL_FFL'], which has mp_form_pageswitch in your config.php

ameotoko commented 2 years ago

Well, actually it IS a bug – in order for custom template to work in frontend, it has to be named form_mp_form_page_switch, but that does not show up in template selector. Selector only shows template group form_mp_form_pageswitch, but then it does not use it in frontend. and then it works fine since Widget::parse() uses customTpl value directly from the database, if present.

Update after more testing: if you copy default form_mp_form_page_switch.html5 template into app templates, it will override the default, but backend will not indicate it (just shows "Default" instead of "global, Default" in template selector). If you then decide to create more different custom templates by adding _something_else to the template filename, you will not be able to find them in the template selector without changing page_switch part to pageswitch.

Toflar commented 1 year ago

I'll rename it from form_mp_form_page_switch to form_mp_form_pageswitch in v5.

Toflar commented 1 year ago

Can you check if https://github.com/terminal42/contao-mp_forms/pull/66 fixes your issue?

ameotoko commented 1 year ago

Unfortunately, I can't check #66 at the moment. The project that had this problem is old and uses PHP 7.4 and Contao 4.12. And I don't remember the context anymore, that was over a year ago. I somehow went around it, and forgot 🤷🏻‍♂️