Block forms are submitted prematurely

Created on 3 March 2019, almost 6 years ago
Updated 9 August 2024, 5 months ago

Postponed on โœจ Add #element_submit and #limit_element_submit just like #element_validate and #limit_validation_errors Needs work

Currently, $block->submitConfigurationForm($elements, $subform_state); is being called inside of Drupal\block_field\Plugin\Field\FieldWidgetBlockFieldWidget::massageFormValues(). Unfortunately, massageFormValues can be triggered by ajax commands, causing a block to be submitted multiple times prematurely. This can cause significant issues if the referenced blocks stores values in separate content/configuration because submit is fired before the parent entity is actually updated.

We should be able to circumvent this issue by utilizing '#element_submit' once it becomes available. The status of this new form property can be found here โœจ Add #element_submit and #limit_element_submit just like #element_validate and #limit_validation_errors Needs work .

I'm marking this postponed for the time being, unless someone knows how we could potentially fix this before the referenced issue is resolved.

๐Ÿ“Œ Task
Status

Postponed

Version

1.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States michaellander

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024