Negate condition works incorrect

Created on 15 December 2020, over 4 years ago
Updated 13 August 2024, 9 months ago

With applied patch πŸ› ConditionManager::evaluate() should not negate results itself Needs work , the negated condition doesn't work.

πŸ› Bug report
Status

Needs review

Version

2.1

Component

Code

Created by

πŸ‡·πŸ‡ΊRussia kiseleva.t

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.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Latest changes should go into 2.1.x - please recheck if this issue still exists!

  • Status changed to Postponed 6 months ago
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    I guess we should better postpone this on πŸ› ConditionManager::evaluate() should not negate results itself Needs work to inform others and use the patch until that, if needed.

  • πŸ‡ΊπŸ‡ΈUnited States droath

    I finally decided to confront this issue myself and began investigating what was happening, while also trying to recall my thoughts during the initial development process. Based on the current architecture of the Drupal condition API, it seems that core conditions are at least managing negation within the evaluation method of the condition plugin. I believe this was the standard that most developers were using within contrib. has well.

    With that in mind, it makes more sense to wait for guidance from Drupal core. If they decide that condition plugins shouldn't handle their own negation, then we can patch the code accordingly. However, until a decision is made, I think the best approach would be to use the Drupal core patch https://www.drupal.org/project/drupal/issues/2535896 πŸ› ConditionManager::evaluate() should not negate results itself Needs work to address this issue. Checking the `$condition->isNegated()` method and negating the value ourselves could introduce more bugs, as there is no clear way to determine whether the condition evaluation method has implemented the negation within the evaluation or not.

Production build 0.71.5 2024