I am trying to import a CSV of user profiles. I have set up a feed using the entity processor branch to allow setting the processor to: "Entity processor Profile". On the settings page for the processor I have the following:
"Default values
Most of the values below can be overriden by mapping a value." (Also there is a minor spelling mistake there = "overridden")
Type *
{Contact Profile}
Label
{Blank}
Date created
{Blank}
User *
{1}
In my mapping I have a csv column called 'uid' mapped to the User target. I believe that should override the author of the profile but it does not. All the profiles are imported linked to user 1.
I tried to take a look through the code but couldn't find where the defaults are set in the time I had.
Comment | File | Size | Author |
---|---|---|---|
#7 | allow-overriding-default-author-1916298.patch | 1.08 KB | Eidolon Night |
Comments
Comment #1
lolcode CreditAttribution: lolcode commentedI have noticed another issue. I am not sure if it is related. The choice of "Entity processor Profile" is not properly staying persistent. When I edit the feed and return to the Processor choice page it has reset the radio button to "Entity processor User". I confirmed this by re-saving this page, leaving the processor choice page and returning. However, it is not losing my settings for the "Entity processor Profile". If I click on processor settings it still has the Contact Profile selected in the dropdown. Also the import process is creating Profiles not users, it's just that all of them are owned by user 1.
Also fixing typo in title.
Comment #2
Sharique CreditAttribution: Sharique commentedI'm having same problem.
It would be better if matching is done using either username or email.
Comment #3
retiredpro CreditAttribution: retiredpro commentedSame problem here using the latest dev version of feeds. Anybody found a solution yet?
Comment #4
ctrlADelI was able to work around this by copying the setTargetElement function from FeedsNodeProcessor.inc and putting it into FeedsEntityProcessor.inc then modifying it as I needed. My function ended up looking like this:
I have a column of uid's so I simply set the uid of the node to the mapped value.
Comment #5
gerson.analista CreditAttribution: gerson.analista commentedI'm having the same problem to import the type Profile2 entities. The code #4 worked to me, I only had to change the line "case 'author':" to "case 'user':"
Comment #6
MegaChriz CreditAttribution: MegaChriz commentedMoving to the Feeds entity processor project, the new home for the generic entity processor.
Comment #7
Eidolon NightHere's a patch for #5 which is also working for me.
Comment #8
GuyPaddock CreditAttribution: GuyPaddock at RedBottle Design, LLC for House at Work commentedThis is now broken with the last commits to 7.x-1.x. We end up with
setTargetElement()
being declared twice.Comment #9
ctrlADelWith this in the dev branch
This issue can probably be considered fixed and closed.
Comment #10
GuyPaddock CreditAttribution: GuyPaddock at RedBottle Design, LLC for House at Work commented@ctrlADel: Can you elaborate on how the two are related?
Comment #11
MegaChriz CreditAttribution: MegaChriz commentedIn #2659900: Support for property type "entity" mapping to entity properties was improved. This module now has support for the following data types:
Other data types are handled the same as if it were text, so not all data types are supported yet.
If the property 'author' or 'user' (as used in the code examples) are declared as type 'user' by the module that provided the property (using an implementation of
hook_entity_property_info()
orhook_entity_property_info_alter()
), then importing values for that property should work (at least in theory).It is a good idea to verify first if importing these values for the reported entity types indeed works now before closing this issue. Behaviour per entity type could vary, because each entity type can have their own specific logic for operations on the entity.