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.
Very useful module, but it throws and 'undefined index' notice if the field in question is an entity reference:
Notice: Undefined index: value in Drupal\entity_field_condition\Plugin\Condition\NodeField->evaluate() (line 156 of modules/contrib/entity_field_condition/src/Plugin/Condition/NodeField.php).
From what I can tell, reference fields don't have a value index $value[0]['value']
, but they do have a target id, e.g. $value[0]['target_id']
Comment | File | Size | Author |
---|---|---|---|
#2 | entity_field_condition-reference-fields-2904228-2.patch | 1.04 KB | justcaldwell |
Comments
Comment #2
justcaldwellHere's a patch that adds support for reference fields by checking for target_id in the field value array.
Comment #3
justcaldwellUpdating status and category.
Comment #4
GiorgosKTried it and works, I think it should be commited
Comment #6
adriancidComment #8
dmezquiaAdded, thanks!
Comment #9
dmezquia