Summary:
After changing a content type's entity reference field Entity Selection Mode from "Simple (with optional filter by bundle)" to "Views: filter by an entity reference view" the feeds importer mapping for that entity reference field no longer allows "Entity reference by Feeds GUID." This is fine if that option is not supported for entity reference fields with the "Views: filter by an entity reference view" selection mode. However, changing the selection mode back to "Simple" does not cause the opposite behavior. A field that has its entity selection mode switched from "Simple" to "Views" and back to "Simple" does not show up on the feeds importer mapping with the "Entity reference by Feeds GUID" option, and there appears to be no way to get this option back. For sites that want to import nodes that contain entity references (and do so via GUID), it appears that they can never try the entity selection mode option of "Views" because it permanently breaks the feeds importer (and any future feeds importers created with that field).

Steps to reproduce:
1. Create two content types.
2. Create an entity reference field in type 1 that points to type 2.
3. Create a feeds importer for node type 1. In the Mapping section, set the entity reference field to "Entity reference by Feeds GUID."
4. Create a feeds importer for node type 2.
5. Import nodes into type 2 and be sure to populate the GUID.
6. Import nodes into type 1 and test the entity reference field import by inserting a GUID for one of the nodes imported in step 5.
7. The nodes of both types should successfully import, and the entity reference field should import correctly as well.
8. Next, edit the entity reference field of content type 1. Change the Entity Selection Mode from "Simple (with optional filter by bundle)" to "Views: filter by an entity reference view." (An entity reference view will need to be set up first.) Save the content type.
9. Look at the Mapping section of the feeds importer for node type 1. The entity reference field will no longer be set to "Entity reference by Feeds GUID" and there is no longer an option for choosing "Entity reference by Feeds GUID" for this field. That seems okay for now because you can't use the Feeds GUID to match against an entity reference field that is using the "Views: filter by an entity reference view" Entity Selection Mode. But, then...
10. Edit the entity reference field of content type 1. Change the Entity Selection Mode BACK from "Views: filter by an entity reference" to "Simple (with optional filter by bundle)" and select node type 2 as the bundle. Save the content type 1.
11. Look again at the Mapping section of the feeds importer for node type 1. The entity reference field mapping is still the same. Remove it and try to add it again. There is no option for "Entity reference by Feeds GUID" for this field at all.

It appears that switching a field from Entity Selection Mode "Simple" to "Views" permanently changes the ability of this field to be imported by Feeds GUID. I have tried saving, clearing caches, and even creating an entirely new feeds importer for node type 1 from scratch, and yet no matter what there appears to be no way that I can ever import this entity reference field via Feeds GUID again.

Comments

potassiumchloride’s picture

Update! This problem appears to come from Entity Reference Autocreate module conflicting with Feeds. I have found that just resaving any entity reference field in a content type then effectively removes the "Entity reference by Feeds GUID" from the feeds importer option. It is not related to entity selection mode. I will edit the title of the issue.

potassiumchloride’s picture

Title: Changing an entity reference field's Entity Selection Mode from "Simple" to "Views" (and back) permanently removes the feeds importer mapping option of "Entity reference by Feeds GUID" for that entity reference field » Entity Reference Autocreate interferes with Feeds

Install Entity Reference Autocreate module and enable, save any entity reference field in a content type, then go to the feeds importer for that content type and the entity reference field will no longer have the Mapping option of "Entity reference by Feeds GUID" - even if you have not checked "Autocreate target if not found" in the Entity Reference Autocreate Settings for that field. It seems that the module causes problems for the feeds importers just by being installed and enabled.

potassiumchloride’s picture

Priority: Major » Normal
potassiumchloride’s picture