Skip to content
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

Widgets parameters #108

Open
readio opened this issue Sep 8, 2019 · 1 comment
Open

Widgets parameters #108

readio opened this issue Sep 8, 2019 · 1 comment

Comments

@readio
Copy link

readio commented Sep 8, 2019

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?

@readio
Copy link
Author

readio commented Sep 8, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant