Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The Feeds User processor doesn't appear to properly support user profile fields.
When I import users, the core user data is created/updated perfectly. However, profile field data is ignored (it maps correctly, it's just not saved to the database)
I think that is because you need to be a little more forceful when trying to save profile data.
A patch is attached which fixes this, and makes all profile data save correctly.
Comment | File | Size | Author |
---|---|---|---|
#12 | 1060230-12-better-suuport-profile-fields.patch | 2.52 KB | hanoii |
#4 | feeds_user_profile_patch.txt | 992 bytes | greenmachine |
2011_02_14-user-profile-fields-fix.patch | 936 bytes | willieseabrook | |
Comments
Comment #1
l_o_l CreditAttribution: l_o_l commentedIndeed I also noticed the profile values where not properly saved: the values where saved as serialized php in the Users->data field instead of the Profile_values->value fields.
That made me look into the issues queue and I came across this patch. Applying it solved the problem.
Thank you !
Comment #2
spuky CreditAttribution: spuky commentedPatch fixed the problem for me... code looks good and resonable...
Comment #4
greenmachine CreditAttribution: greenmachine commentedI had better luck with this modified version of the patch. Was getting a "Duplicate entry" MYSQL error with the previous patch. I think that was because the incoming $account array still contained $account['uid'] = 0.
Comment #5
KeesMK CreditAttribution: KeesMK commentedThere are more questions regarding the following issue: How to import Profile 2 fields.
In the patch is mentioned: Profile fields don't save unless you specify the category they belong to.
Is this also regarding Profile 2 fields but how must the fields be specified exactly.
Is it with Feeds possible to handle this and how can this been done.
Thanks very much for any answer and help.
Regards, Kees
Comment #6
caktux CreditAttribution: caktux commentedPatch in #4 worked for me, but I'm not sure this is the right way to go...
Comment #7
rumblewand CreditAttribution: rumblewand commentedStill a problem in Beta 11 manually applied the patch above and seems to have solved my problem. I was getting most of my profile fields. It was leaving one out for some reason (numbers with a hyphen). Strange because the a phone number did come in correctly.
Also, editing the user account and resaving the field with the original value in it saved it to the database.
Comment #8
rumblewand CreditAttribution: rumblewand commentedI'm a liar. The patch above did fix my missing account number field but at the cost of about 8 other fields. Looking into it.
Comment #9
alibama CreditAttribution: alibama commented#4 didn't work for me... seriously? feeds won't map to core user fields? that's kinda bogus since it sees them... really tricked me pretty hard, thought i had ingested 40,000 nodes, turns out i've got 0
is anyone testing against http://drupal.org/node/783098?
Comment #10
alibama CreditAttribution: alibama commentedit's a miserable approach, since i needed feeds to properly process the organic groups data (through a patch) i went back and used user import to update the profile fields and leave the OG data untouched.. it seems to be working.. .
Comment #11
jtwalters CreditAttribution: jtwalters commentedI'm not sure if this is the right approach below, but I figured out a workaround for preventing non-mapped user data from being lost. In FeedsUserProcessor.inc it looks like we need to pass in the full user object:
// Map item to a term.
- $account = $this->map($batch);
+ $account = $this->map($batch, user_load($uid));
Comment #12
hanoiiI believe this is a simplified patch of both #4 and #11 combined if anyone is interested. I also tried to work some tests to help this be committed but locally a lot tests failed, not sure if I am doing something wrong with the test environment (downloaded simpletest, patched core, get dev version of this module and run test).
Also I wonder how much support this module still has for D6, so patch here for now.
Patch is against beta12
Comment #13
alibama CreditAttribution: alibama commentedAloha Hanoii = fwiw this patch looks to be based perhaps from features
diff --git a/sites/all/modules/evaluaciones/evaluaciones.module b/sites/all/modules/evaluaciones/evaluaciones.module is on line 5... in any case I'm curious to see what you've got - thanks for the effort
aloha
ap
Comment #14
twistor CreditAttribution: twistor as a volunteer commented