magento2-configurator
magento2-configurator copied to clipboard
Widgets parameters
When creating widgets I get the below error in Magento admin when trying to view the created widget:
Exception #0 (InvalidArgumentException): Unable to unserialize value. Error: Syntax error
This seems to be caused by the way key/values are created. Using the code from the sample widget.yaml it creates the below in the database field 'widget_parameters' :
a:1:{s:8:"block_id";s:1:"1";}
If I manually change this to below the error goes away.
{"block_id":"1"}
Is this a known issue?
I have fixed this by changing the 'populateWidgetParameters' function in 'Components/Widgets.php'
I have changed
return serialize($parameters);
to
return json_encode($parameters);
This inserts the parameters into the database in the correct format.