You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all: MCW is a great extension. Thank you for providing it!
Second: I'm not sure if this is a bug in MCW or should be addressed in contao/core. Please correct me if this is wrong here. Or maybe I just missed something.
Setup
Contao 3.5.35 (clean installation)
MultiColumnWizard 3.3.6/4
one custom test extension "mcw-multiselect-test" (see below)
Expected behaviour
When editing a MCW field with a text column and a multi-select column i expect all filled in values to be saved into the Database.
Faulty behaviour
The text field value stays empty while the selection is saved to the database.
Analysis
There seems to be a bug when rendering the select field. The hidden input that is rendered for multiple select fields has the name rsm_mcw_multiselect_test[0][tag_select (note the missing closing bracket).
This seems to result in data loss while receiving data server side. When var_dumping $_REQUEST i can see the values for tag_select but no values (not even the field's name) for tag_name. Maybe the field order is important here, since the wrong field name is for the select while the affected field's data lies above the faulty one (as seen in the http request body).
The issue seems to lie in \Contao\SelectMenu::generate()'s use of rtrim($this->strName, '[]') in system/modules/core/widgets/SelectMenu.php. (This is why I'm not sure where to open post this issue.) The usage of rtrim does not seem to be a new thing in that place. (contao/core#7760)
Extension mcw-multiselect-test
This test extension basically only adds a new content element with a MCW field.
@zonky2 Thanks for the hint. I only checked the ER for updates.
The issue still exists in 3.3.16.
I deleted the old version of multicolumnwizard, added 3.3.16 from the zip file in the release note, made sure it is uploaded correctly and cleared browser cache.
I also disabled my workaround and put an exit in my custom generate function, just to make sure that it is not active anymore.
First of all: MCW is a great extension. Thank you for providing it!
Second: I'm not sure if this is a bug in MCW or should be addressed in contao/core. Please correct me if this is wrong here. Or maybe I just missed something.
Setup
Contao 3.5.35 (clean installation)
MultiColumnWizard 3.3.6/4
one custom test extension "mcw-multiselect-test" (see below)
Expected behaviour
When editing a MCW field with a text column and a multi-select column i expect all filled in values to be saved into the Database.
Faulty behaviour
The text field value stays empty while the selection is saved to the database.
Analysis
There seems to be a bug when rendering the select field. The hidden input that is rendered for multiple select fields has the name
rsm_mcw_multiselect_test[0][tag_select
(note the missing closing bracket).This seems to result in data loss while receiving data server side. When
var_dump
ing$_REQUEST
i can see the values fortag_select
but no values (not even the field's name) fortag_name
. Maybe the field order is important here, since the wrong field name is for the select while the affected field's data lies above the faulty one (as seen in the http request body).The issue seems to lie in
\Contao\SelectMenu::generate()
's use ofrtrim($this->strName, '[]')
insystem/modules/core/widgets/SelectMenu.php
. (This is why I'm not sure where to open post this issue.) The usage ofrtrim
does not seem to be a new thing in that place. (contao/core#7760)Extension mcw-multiselect-test
This test extension basically only adds a new content element with a MCW field.
The text was updated successfully, but these errors were encountered: