Skip to content
Snippets Groups Projects

Issue #3251378: Block Plugins don't store their context mappings on submit

Closed Issue #3251378: Block Plugins don't store their context mappings on submit
All threads resolved!
Closed Víctor Dorado requested to merge issue/drupal-3251378:3251378-11.x into 11.x
All threads resolved!
Files
3
@@ -24,6 +24,7 @@ abstract class BlockBase extends PluginBase implements BlockPluginInterface, Plu
use BlockPluginTrait {
buildConfigurationForm as traitBuildConfigurationForm;
submitConfigurationForm as traitSubmitConfigurationForm;
}
use ContextAwarePluginTrait;
use ContextAwarePluginAssignmentTrait;
@@ -41,4 +42,14 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
return $form;
}
/**
* {@inheritdoc}
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state): void {
if (!$form_state->getErrors() && $form_state->getValue('context_mapping')) {
$this->configuration['context_mapping'] = $form_state->getValue('context_mapping');
}
$this->traitSubmitConfigurationForm($form, $form_state);
}
}
Loading