I just wanted to report an error I have with the entityreference_feeds module : whenever I use feeds to write nodes with an entityreference field attached to them, I have the following error showing un in the feeds config page (it does not prevent feeds from working however) :

Notice: Undefined variable: field_instance in _entityreference_feeds_get_targets() (line 75 of /var/www/d7test/sites/all/modules/entityreference_feeds/entityreference_feeds.module)

I tried to search for orphaned values in the filed_config and field_config_instance, but I don't think it is coming from a field that was not properly removed.

Any idea why this keeps showing up? Thanks !

Feeds 7.x-2.0-alpha8
Entity Reference 7.x-1.0


Same issue with same config here.

For my case, entity reference works by matching all IDs from imported CSV to only one (last updated) node.

Source Target
EANHotelID field_hotelid (hotel: Hotel ID)

new17 KB

We too came across this message - taking a deeper dive into the code, this looks like a scope/incomplete code issue:
$field_instance['label'] is set in the entityreference_feeds_feeds_processor_targets_alter() function and referenced on line 75 in _entityreference_feeds_get_targets(), but it is not passed as a parameter into the function.

Additionally, where it is referenced on line 75 it does not serve any purpose as it is not part of the $entity_target['description'].

My humble recommendation is that it is removed (if indeed it is not required), or if it is needed, that it is passed in as a parameter and the correct code is added to the t() function that sets $entity_target['description'].

Any recommendations?

Note: I've uploaded an updated version of entityreference_feeds.module (entityreference_feeds.txt - remane extension to module and you're golden) that excludes the reference to $field_instance['label'])



I'm also having this issue — about to try out the above replacement 'entityreference_feeds.module' file, and would love to see this patched in if this is the fix.

Attached a patch according to your comment (I did not reviewed it fully yet).

Status:Active» Closed (fixed)

This should be fixed in the latest dev-snapshot. Thanks for the feedback.