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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

l_o_l’s picture

Indeed 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 !

spuky’s picture

Status: Needs review » Reviewed & tested by the community

Patch fixed the problem for me... code looks good and resonable...

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2011_02_14-user-profile-fields-fix.patch, failed testing.

greenmachine’s picture

FileSize
992 bytes

I 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.

KeesMK’s picture

There 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

caktux’s picture

Patch in #4 worked for me, but I'm not sure this is the right way to go...

rumblewand’s picture

Still 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.

rumblewand’s picture

I'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.

alibama’s picture

#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?

alibama’s picture

it'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.. .

jtwalters’s picture

I'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));

hanoii’s picture

I 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

alibama’s picture

Aloha 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

twistor’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)