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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ginovski created an issue. See original summary.

Ginovski’s picture

Assigned: Unassigned » Ginovski
Status: Active » Needs review
FileSize
1.15 KB

Added subform state

Status: Needs review » Needs work

The last submitted patch, 2: use_subform_state_for-2849503-2.patch, failed testing.

Ginovski’s picture

Fixed test

Berdir’s picture

Looks 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...

Berdir’s picture

Status: Needs review » Needs work

As discussed, lets do this here.

miro_dietiker’s picture

Priority: Normal » Critical

Let's get this in ASAP as it's breaking our contract.

Ginovski’s picture

Changed the build/validate/submit behaviorForm arguments.

Ginovski’s picture

Title: Use subform state for the validateBehaviorForm() » Use subform state for the BehaviorForm() functions
Ginovski’s picture

Ginovski’s picture

miro_dietiker’s picture

Status: Needs review » Fixed

Committed, thx! Time to fix the Colllection! :-)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.