Problem/Motivation
There is a problem in the order of page layout and conditions that are not met.
Steps to reproduce
- Create node article display
- Create a default page layout without condition
- Create a page layout for content type article with condition "Content type is article"
- Set the article page layout before the default
Go to an article, the default page layout is used.
Add condition to default "Content type is not article"
Then the article layout is the correct one. But should work by precedence without adding more condition.
Proposed resolution
Looks like we have the context but not the mapping, so for entity_bundle:node context (condition by bundle), we have an
empty context mapping and it cannot be resolved.
When block for example with same context will have "node" => "@node.node_route_context:node" for getContextMapping when we have an empty array.
Probably we are missing a setContextMapping when saving the form, this is what block is doing.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork display_builder-3561312
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
pdureau commentedMaybe a context is not injected properly to the condition plugin.
Comment #3
mogtofu33 commentedComment #4
mogtofu33 commentedComment #5
mogtofu33 commentedComment #6
mogtofu33 commentedComment #9
mogtofu33 commentedComment #11
pdureau commentedThanks Jean.