Active
Project:
Computed Field
Version:
7.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Nov 2012 at 06:23 UTC
Updated:
6 Nov 2012 at 06:23 UTC
I'm using the Entity Reference module (http://drupal.org/project/entityreference) and want a computed field that stores a list of entity references from multiple fields, so that I can filter against the computed field in a view. However, with the following code:
$entity_field[0]['value'] = "array_pop(array_pop(field_get_items($entity_type, $entity, 'field_a')))";
$entity_field[1]['value'] = "array_pop(array_pop(field_get_items($entity_type, $entity, 'field_b')))";
$entity_field[1]['value'] = "array_pop(array_pop(field_get_items($entity_type, $entity, 'field_c')))";
I get the following error:
Recoverable fatal error: Object of class stdClass could not be converted to string in eval() (line 1 of /.../sites/all/modules/computed_field/computed_field.module(466) : eval()'d code).
Is there a way of doing this, or is Computed Field not presently compatible with Entity Reference fields?