Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#3 | notification_message-negated-condition-not-evaluated-correctly-3127804-3.patch | 602 bytes | droath |
#2 | notification_message-negated-condition-not-evaluated-correctly.patch | 688 bytes | n_e_ |
Comments
Comment #2
n_e_ CreditAttribution: n_e_ as a volunteer commentedComment #3
droath CreditAttribution: droath at Aten Design Group commentedComment #5
droath CreditAttribution: droath at Aten Design Group commentedThank you for the patch! Fixed!
Comment #6
droath CreditAttribution: droath at Aten Design Group commented