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']

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

justcaldwell created an issue. See original summary.

justcaldwell’s picture

Here's a patch that adds support for reference fields by checking for target_id in the field value array.

justcaldwell’s picture

Category: Bug report » Feature request
Status: Active » Needs review

Updating status and category.

GiorgosK’s picture

Status: Needs review » Reviewed & tested by the community

Tried it and works, I think it should be commited

adriancid’s picture

Category: Feature request » Bug report

  • dmezquia committed 86504c9 on 8.x-1.x authored by GiorgosK
    Issue #2904228 by justcaldwell, GiorgosK, dmezquia, adriancid: Not...
dmezquia’s picture

Added, thanks!

dmezquia’s picture

Status: Reviewed & tested by the community » Fixed

  • dmezquia committed 831b74b on 8.x-1.x
    Revert "Issue #2904228 by justcaldwell, GiorgosK, dmezquia, adriancid:...
  • dmezquia committed f9930d3 on 8.x-1.x authored by justcaldwell
    Issue #2904228 by justcaldwell, dmezquia, GiorgosK, adriancid: Not...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.