Closed (fixed)
Project:
Paragraphs Collection
Version:
8.x-1.x-dev
Component:
Style
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Oct 2018 at 10:20 UTC
Updated:
31 Oct 2018 at 16:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mbovan commentedQuick fix.
Comment #3
ytsurkSeems fine to me and works.
Comment #4
johnchqueJust tried this out, cannot reproduce the problem. Was there any extra patch added here?
I cannot reproduce since in the ParagraphsWidget file there is a check to see if the behavior_plugins element was added, having only one style set as default wouldn't go through that check and thus we wouldn't get this error.
[EDIT] Just tested again and this happens when having more than one Style enabled. Updating the issue summary.
Comment #5
johnchqueComment #6
johnchqueThere we go, this should trigger the bug.
Fixing issue title.
Comment #8
berdiryou can probably simplify this to $form_state->getValue('style_wrapper', [])
Do we really need a JS test to trigger this? Might be easier and faster with a plain browser test?
All the fields are there to in a browser test.
If it requires JS then we should merge it with the ParagraphsCollectionStyleTest that I added in the other issue.
Comment #9
johnchqueHa! Took me longer than expected. Somehow when trying to create the paragraph through the UI, the groups config of the Style plugin was null. Not sure what went wrong there, switched to setting config programatically. :)
The error I got was
[EDIT] If happens again I will create an issue.
Comment #11
berdirstill too complicated?
Just do $paragraph->setBehaviorSettings($this->pluginId, $form_state->getValue('style_wrapper', [])); the second argument is the default and that already ensures that it is always an array.
Comment #12
johnchqueHa! Didn't notice that, thanks! Updating, no interdiff, too big. :)
Comment #13
johnchqueOops, my bad.
Comment #17
berdirCommitted.