Problem/Motivation
BlockBase doesn't store the context mapping on submitConfigurationForm, even though it adds the necessary elements in build configuration form.
Steps to reproduce
- Add a field_block on layout builder.
- Notice that the context_mapping has not been stored.
Proposed resolution
Add the context_mapping form value to $this->configuration in BlockBase class after submitting the configuration form.
Remaining tasks
Fix. DoneTests. Done
User interface changes
None
Introduced terminology
None
API changes
None
Data model changes
None
Release notes snippet
NA
| Comment | File | Size | Author |
|---|
Issue fork drupal-3251378
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
rlmumfordComment #7
smustgrave commentedCan you update your PR to point to 9.5 please
Comment #8
ameymudras commentedRefactoring the above patch to 9.5.x so that we can proceed with the issue fix
Comment #10
smustgrave commentedThank you for the patch.
This will also need a valid test.
Comment #17
vidorado commentedAdded a Kernel test to test the new behavior.
Comment #20
smustgrave commentedLeft comments on MR for consistency
If you are another contributor eager to jump in, please allow the previous poster at least 48 hours to respond to feedback first, so they have the opportunity to finish what they started!
Comment #21
vidorado commented@smustgrave, I've applied your two suggestions and left a reply to your third MR comment of what I think @rlmumford pretended to do.
Thanks!
Comment #22
smustgrave commentedLeaving the 1 thread open but rest of the feedback appears to be addressed
Comment #24
catchI kind of wondered if we want functional test coverage for this to show what actually breaks (which I am not clear about to be honest), but the kernel test is pretty clear.
Committed/pushed to 11.x, thanks!
Comment #27
douggreen commentedThis should have a change record because now any overrides of BlockBase::submitConfigurationForm() require the void typehint.
Comment #28
acbramley commentedYeah just hit #27 when hunting down phpunit failures on 11.2
Comment #29
harlor commentedExample in contrib: https://www.drupal.org/project/spa/issues/3526733#comment-16203161 (comment #8)
I'm wondering if we should specify the return type when there is no return type on the interface in this case PluginFormInterface yet.
Comment #30
acbramley commented@harlor see #3537720: [regression] Remove return type from BlockBase::submitConfigurationForm(), we are reverting the return type.