Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The validateBehaviorForm is not using a subform state for the behavior plugins, as the validateConfigurationForm is.
Check \Drupal\paragraphs\Form\ParagraphsTypeForm
$subform_state = SubformState::createForSubform($form['behavior_plugins'][$id]['settings'], $form, $form_state);
$behavior_plugin = $paragraphs_type->getBehaviorPlugin($id);
$behavior_plugin->validateConfigurationForm($form['behavior_plugins'][$id]['settings'], $subform_state);
Proposed resolution
Use subform_state for the behavior plugins in validateBehaviorForm.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#11 | behavior_subform_state-2849503-11.patch | 11.1 KB | Ginovski |
#10 | behavior_subform_state-2849503-10.patch | 11.57 KB | Ginovski |
#10 | interdiff-2849503-8-10.txt | 2.25 KB | Ginovski |
#8 | behavior_subform_state-2849503-8.patch | 11.01 KB | Ginovski |
#4 | use_subform_state_for-2849503-4.patch | 2.09 KB | Ginovski |
Comments
Comment #2
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commentedAdded subform state
Comment #4
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commentedFixed test
Comment #5
BerdirLooks fine but wondering if we don't want to do this for submit as well. I'm actually not sure why we don't and just pass in the $values. Unlike this, that would be an API change of course that would break plugins. But better now than later...
Comment #6
BerdirAs discussed, lets do this here.
Comment #7
miro_dietikerLet's get this in ASAP as it's breaking our contract.
Comment #8
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commentedChanged the build/validate/submit behaviorForm arguments.
Comment #9
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commentedComment #10
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commentedChanges in the form passing.
Comment #11
Ginovski CreditAttribution: Ginovski at MD Systems GmbH commentedRemoving unrelated change
Comment #13
miro_dietikerCommitted, thx! Time to fix the Colllection! :-)