Both functions try to get the target_type from $items[0]['target_type'].
But the $items[0] array only has a ['target_id'] index. This results in numerous repeating errors like this:
Notice: Undefined index: target_type in entityreference_field_uuid_load() (line 256 of /sites/all/modules/contrib/uuid/uuid.core.inc).
Notice: Undefined index: entity keys in entityreference_field_uuid_load() (line 256 of /sites/all/modules/contrib/uuid/uuid.core.inc).
This is also preventing me from doing a drush cc all.
The solution seems to be to get the target type from the $field argument passed to both functions. Each entityreference field has to be configured for a single entity type (target_type), so getting the target_type from the $field['settings']['target_type'] should be fine.
Patch coming.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | target_type_from_field_settings.1511274.patch | 1.09 KB | jamesharv |
Comments
Comment #1
jamesharv commentedPatch attached
Comment #2
jamesharv commentedUpdating status
Comment #3
skwashd commentedLooks good. Committed as 51500e6.
Comment #5
David_Rothstein commentedSee also this related issue in the Entity Dependency API module: #1545278: Dependencies are not added for entityreference fields (Symptom: "Undefined index: target_type")