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

Command icon 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

mogtofu33 created an issue. See original summary.

pdureau’s picture

Maybe a context is not injected properly to the condition plugin.

mogtofu33’s picture

Issue summary: View changes
mogtofu33’s picture

mogtofu33’s picture

Assigned: Unassigned » mogtofu33
Status: Active » Needs work
mogtofu33’s picture

Issue summary: View changes

  • mogtofu33 committed 09d033a3 on 1.0.x
    fix: #3561312 working conditions when context mapping
    
    by: mogtofu
    
mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

pdureau’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.