ConditionManager::evaluate() should not negate results itself

Created on 19 July 2015, over 9 years ago
Updated 14 April 2024, 7 months ago

Problem/Motivation

\Drupal\Core\Condition\ConditionManager::evaluate() negates the outcome of condition evaluation results. While ConditionInterface has an ::isNegated() method, negation is in fact part of the conditions' implementations and one would expect the negation to performed as such. However, if that is done, ConditionManager will negate the outcome yet again.

This is bad design at least, and maybe a bug, because plugins should be usable without the default condition manager implementation.

Proposed resolution

- Refactor Condition and Condition Plugins - correcting the evaluate implementations and isNegated usage (after "condition" results)

Remaining tasks


Code review

User interface changes

None.

API changes

Data model changes

None.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
PluginΒ  β†’

Last updated about 1 hour ago

Created by

πŸ‡¬πŸ‡§United Kingdom Xano Southampton

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

  • Needs framework manager review

    It is used to alert the framework manager core committer(s) that an issue significantly impacts (or has the potential to impact) multiple subsystems or represents a significant change or addition in architecture or public APIs, and their signoff is needed (see the governance policy draft for more information). If an issue significantly impacts only one subsystem, use Needs subsystem maintainer review instead, and make sure the issue component is set to the correct subsystem.

Sign in to follow issues

Merge Requests

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