-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Widget] Fixing the multidimensional array as value for the widget's parameter #21008
[Widget] Fixing the multidimensional array as value for the widget's parameter #21008
Conversation
Hi @eduard13. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
@@ -166,7 +166,9 @@ protected function _addField($parameter) | |||
|
|||
if (is_array($data['value'])) { | |||
foreach ($data['value'] as &$value) { | |||
$value = html_entity_decode($value); | |||
if (!is_array($value)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to check the value on string type: if(is_string($value)) because this check will fail if $value will be an object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sidolov makes sense. Thank you.
Hi @sidolov, thank you for the review. |
494b81b
to
718bb76
Compare
Hi @eduard13, thank you for your contribution! |
…the widget's parameter #21008
Description (*)
This PR gives the possibility to use a multi row field as a parameter for a widget.
After saving the widget, or opening, you'll have 2 exceptions thrown:
Warning: html_entity_decode() expects parameter 1 to be string, array given in /home/dev/sites/mage23/app/code/Magento/Widget/Block/Adminhtml/Widget/Options.php on line 170
Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/dev/sites/mage23/lib/internal/Magento/Framework/Data/Form/Element/AbstractElement.php on line 290
As a result, you should are able to save and open the widget:
Fixed Issues (if relevant)
Manual testing scenarios (*)
Contribution checklist (*)