- πΊπΈUnited States dcam
Since Drupal 7 is now end-of-life I am closing some old issues for the 7.x branch of this module. If this issue is still relevant for the 3.x branch of the module, then feel free to reopen it.
If you use a debugger to watch entityreference_field_validate(...) function, you'll see that the IEF fields pass right through this section:
foreach ($items as $delta => $item) {
if (!entityreference_field_is_empty($item, $field) && $item['target_id'] !== NULL) {
$ids[$item['target_id']] = $delta;
}
}
There is no $item['target_id'], so the $valid_ids is never checked.
I'm not sure if this is a feature or a bug. I ran into it when using EFQ Views as my autocomplete results which does set a a target_id, but it's directly on $item, $item is not an array like $item['target_id'] = 1234, but $item = 1234. That was causing invalid referenced entity errors.
IEF will create an $item like this:
$item = array(
'entities' => array(
array(
'delta' => 0,
'actions' => array(...)
)
)
);
The entityreference_field_validate(...) function expects $item to have a 'target_id' key for it to actually validate the $ids.
Closed: duplicate
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Since Drupal 7 is now end-of-life I am closing some old issues for the 7.x branch of this module. If this issue is still relevant for the 3.x branch of the module, then feel free to reopen it.