Closed (fixed)
Project:
Paragraphs Collection
Version:
8.x-1.x-dev
Component:
Style
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
20 Sep 2018 at 13:42 UTC
Updated:
29 Oct 2018 at 17:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
primsi commentedNot sure about tests here. We don't seem to have collection js tests yet.
Comment #3
berdirThe only reason we stopped just using $form is to fix some problems, lets check this with @mbo next week.
Comment #4
mbovan commented#3: Yes, we didn't want to produce any additional markup if there are no styles to select. That was the reason to switch away from
$formand use$build.Either we do this here for the style plugin only, or we append the plugin behavior form array in
Drupal\paragraphs\Plugin\Field\FieldWidget\ParagraphsWidget::formElement()as$element['behavior_plugins'][$plugin_id] += $plugin_form;?Related issues: #2971115: Do not print behavior form if there is nothing a plugin can do, #3002419: Base buildBehaviorForm should not add markup for plugins with no behavior form
Comment #5
johnchqueWorking on tests for this. :)
Comment #6
johnchqueI was checking the code of other plugins and it seems we always used the form variable to add all the plugin elements. I think is better to make them all equal to making it easier to change later. (e.g. not adding any markup at all if there are no plugins).
Comment #9
johnchqueMy bad. :(
Comment #12
berdirYes, lets revert that change for now, we do have test coverage now in case we decide to improve that later, then we could also add test coverage for the specific problem that solves in regards to the markup...