In _entityreference_feeds_get_targets an internal cache exists, keyed with target_type and target_bundle. The reasoning behind this is that the targets are unique per entity_type and bundle, and could be shared across fields. This is not actually the case since the field_name is baked into the key, name, description etc though, so this will break if there are more than one entityreference field referencing the same entity type and bundle. We could perhaps break out the reusable information, cache this, and just apply the field specific information for each target.

Comments

gnucifer’s picture

Issue summary: View changes

Clarification

gnucifer’s picture

On the other hand, better safe than sorry. This small optimization is probably not worth the effort, and I guess its not very common anyway to have multiple fields referencing the same type of entities on the same content type. I'm leaning against caching on a field-basis instead to avoid potential bugs and extra complexity.

gnucifer’s picture

Issue summary: View changes

Correction

MauPalantir’s picture

I have an issue from this behavior. I have two groups audience field (which are entityreference fields) on a node type that references the same content bundle but serve different purposes.
I have to fill one by feeds import, but it does not appear in the targets list (only the other, for all the types).

MauPalantir’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.39 KB
gnucifer’s picture

Thanks! Commited.

gnucifer’s picture

Status: Needs review » Closed (fixed)