Negate option fails

Created on 3 February 2020, almost 5 years ago
Updated 13 April 2023, over 1 year ago

Problem/Motivation

Hi,

Can we have the node_field condition plugin to support negation by providing the Context on node to be "required = FALSE"?

Now when we are not on a node page, it won't negate because it needs a node context.

Proposed resolution

Update the plugin annotation as context.node.required = FALSE :

/**
 * Provides a 'Node Field' condition.
 *
 * @Condition(
 *   id = "node_field",
 *   label = @Translation("Node Field"),
 *   context = {
 *     "node" = @ContextDefinition(
 *       "entity:node",
 *       required = FALSE,
 *       label = @Translation("node")
 *     )
 *   }
 * )
 */

Remaining tasks

Discuss, test & review

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇧🇪Belgium baikho Antwerp, BE

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024