Problem/Motivation
I'm using the module Page Manager to set up a generic page. This module supports me to build a page by using layout builder. I'd like to place blocks that are created from SDC to regions and I run into an error
Drupal\Component\Plugin\Exception\ContextException: The display context is not a valid context. in Drupal\layout_builder\Plugin\SectionStorage\SectionStorageBase->getContextDefinition() (line 150 of /var/www/html/web/core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php).
After spending some time digging into the code, I see that when I use layout builder, the blocks I place in the layout is EntityComponentBlock, and these entity blocks require an entity context, which does not exist if I use Layout Builder in Page Manager module. So I think, in my case, instead of placing entity component blocks, I just need to use component blocks, and I came up with a patch :-) Happy to have someone review my patch. Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | ui_patterns_block_remove_entity_blocks.patch | 3.26 KB | sea2709 |
| ui_patterns_block_remove_entity_blocks.patch | 3.22 KB | sea2709 |
Issue fork ui_patterns-3535728
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 #2
sea2709 commentedI just found out that there was a mistake in my patch. So this is the updated one.
Comment #3
pdureau commentedThanks a lot Dang Tran. We will have a look after 2.0.6 release.
Comment #4
pdureau commentedComment #5
pdureau commentedComment #9
pdureau commentedReviewed by Florent& Pierre.
No ContextException anymore.
Notice: I see an entity context in layout bulder with page manager, probably with the Page entity , but the context seems to be missing when the page is displayed.
Comment #10
just_like_good_vibesthanks
Comment #12
just_like_good_vibes