Postponed
Project:
Entity Extra Field
Version:
2.1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Dec 2020 at 05:12 UTC
Updated:
29 Jan 2025 at 23:26 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
kiseleva.t commentedComment #3
gngn commentedI think negate does not work at all - but will work once the linked core issue #2535896: ConditionManager::evaluate() should not negate results itself is commited.
With the patch in #2535896 (comment #29) every condition will consider a negation itself - then and only then the current logic in EntityExtraField::hasConditionsBeenMet() would work with negated conditions.
That issue hadn't been worked on for two years - so I think entity_extra_field should handle the negation itself (until the core issue is commited).
So I think this issue's description is wrong - in my opinion it should be:
Without applied patch #2535896: ConditionManager::evaluate() should not negate results itself, the negated condition doesn't work.
That said: #2 worked for me.
Comment #4
anybodyLatest changes should go into 2.1.x - please recheck if this issue still exists!
Comment #5
anybodyI guess we should better postpone this on #2535896: ConditionManager::evaluate() should not negate results itself to inform others and use the patch until that, if needed.
Comment #6
droath commentedI 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 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.