Needs review
Project:
Entity reference
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Nov 2012 at 17:33 UTC
Updated:
15 Oct 2019 at 15:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
alisonComment #2
megachrizA feature like this seems to be planned for the Feeds entity reference module.
Comment #3
colanAs per #1875848: doesnt work, it looks like that module filled the hole that is now satisfied by #1616680: Handle more mapping keys in Feeds integration so it is no longer necessary. It does not appear to create referenced entities.
I'd like to see taxonomy terms created when I'm importing term reference fields as strings with the mapping Entity reference by Entity label. If the term doesn't exist yet (i.e. no match for the label), a new term would be created. This would be better than these error messages:
Moving to the ER queue as Feeds support for this sort of thing should be handled in there.
Comment #4
colanLooks like Entityreference Autocreate may do the trick for now.
Comment #5
anweshasinha commentedI have created a patch on entityreference module which will create referenced entities using a Feeds importer of the referenced entity.
This works in the following way:
1. Suppose you have 4 entities A,B and C. Entity A has a field A which refers to Entity B, and Entity B has a field B which refers to Entity C.
2. Create importers for all the entities – first C, then B and then A. In mapping page of importer for entity B, you need to select the target as "(Entity reference by Entity label - with import) (field_hotel:importer:hotel_importer)" as show in the attached screenshot. Similarly create mapping for entity A.
3. Create a single CSV with columns from all three importers and upload it against importer of Entity.
4. When entities of type A are imported, entities of types B and C also get created on the fly.
Comment #6
anweshasinha commentedComment #7
anweshasinha commentedRevised patch to make it work for User Entities
Comment #8
anweshasinha commentedSorry wrong patch, resubmitting!
Comment #12
anweshasinha commentedPatch resubmitted. Now working in entityreference 7.x-1.x-dev
Comment #13
anweshasinha commentedComment #14
FireHawkX commentedIf only I had known this existed before! (been wasting so many hours trying to fix a problem)
First, the patch applied without issue to latest version.
However, on 1 of my 12 feeds importer, when I open the page "mapping for node processor page" (or tamper)
I get a couple hundreds of the following error :
Warning: in_array() expects parameter 2 to be array, null given in entityreference_feeds_processor_targets_alter() (line 57 of ...\sites\all\modules\entityreference\entityreference.feeds.inc).EDIT :
Seems like my test was poorly done, I thought it worked, but after more analyse, only the fields set to "terms reference" actually created new taxonomy terms... the entity reference did not create the terms sadly :(
I did another test with a brand new feeds importer with only 2 fields in there... both entity references... and i got 242 errors of "term not found" and no terms got created
Note that by reverting to previous version, all the warnings stopped appearing
Let me know if you desire me to provide more info, or do additional testing
Finally, for anyone checking here for a workaround/solution, I created a couple of new feeds importer that only imported the new data directly into their respective taxonomy... then I was able to link them using "Query finder" during my import of the actual nodes using Entity References instead of Terms reference since they already existed!
Comment #15
Mile3 commentedCurious if anyone has been able to get this to work on D8/9?