Closed
Description
Summary (*)
Magento
2.2.*, 2.2.5, 2.2.6, 2.2.7
Not possible to use multidimensional arrays in widget parameters
When add custom field set as a block parameter type to widget.xml
Examples (*)
Add custom parameter type (in my case it is an options panel)
Use parameters names and keys like this
parameters[groups_options][order][option[1]: 0
parameters[groups_options][title][option][1][store][0]: store_label_admin
parameters[groups_options][title][option][1][store][1]: store_label_1
parameters[groups_options][title][option][1][store][2]: store_label_2
in this file the code looks like this
magento/vendor/magento/module-widget/Model/Widget/Instance.php:609
if ($name == 'conditions') {
$name = 'conditions_encoded';
$value = $this->conditionsHelper->encode($value);
} elseif (is_array($value)) {
$value = implode(',', $value);
}
It is not really possible to reproduce on vanilla instance but we can try to substitute a request parameters for existing widget fields
Proposed solution
// can't we simply serialize an input here instead of implode it ?
// anyway in the database 'widget_instance' all widget values are included in json
$value = implode(',', $value);
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.2 release lineThe issue has been fixed in 2.3 release lineGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release