Hello - first of all, thank you for creating this very useful module.

Problem/Motivation

I've noticed that adding a negation to a condition on a message has no effect. I've stepped through the code and where the conditions are evaluated in computeConditionInstance the method doesn't factor in $instance->isNegated()

Proposed resolution

The core ConditionManager evaluation code does the following:

...
      $result = $condition->evaluate();
      return $condition->isNegated() ? !$result : $result;
 ...

In the attached patch I've added that same check and negated conditions now work as expected.

Remaining tasks

- Review patch

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

n_e_ created an issue. See original summary.

n_e_’s picture

droath’s picture

  • droath committed 5910d48 on 8.x-1.x
    Issue #3127804 by n_e_, droath: Negations not accounted for when...
droath’s picture

Status: Active » Fixed

Thank you for the patch! Fixed!

droath’s picture

Status: Fixed » Closed (fixed)