Download & Extend

add support for user profile fields

Project:Migrate
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:mikeryan
Status:closed (fixed)

Issue Summary

Currently it's not possible to map to user profiles fields created by the core profile module. The attached patch adds this functionality, but only for fields that are visible on the user registration form. This is to do with the way profile_save_profile() and _profile_get_fields() work. Longer term it'd be nice if it worked for fields that don't appear on the registration form, but the same result could be achieved by changing the profile field settings after the initial import.

Cheers,
Stella

AttachmentSize
user_profile_fields.patch832 bytes

Comments

#1

Status:needs review» needs work

Wouldn't omitting WHERE register=1 give all profile fields?

Thanks.

#2

Status:needs work» needs review

yes, but if you look at the source code of profile_save_fields() and in particular _profile_get_fields() , you'll see that it'll only process those with register = 1 when inserting new users. So I put in the "WHERE register = 1" so as to not show fields to the user that we can't update.

#3

Assigned to:Anonymous» mikeryan

OK, I've created a separate profile.inc and implemented a solution for all profile fields (stash them away in the prepare_user hook then call profile_save_profile() in the complete_user hook).

This is not heavily tested at the moment (in particular, I didn't test all the types of profile fields), please give it a spin and let me know if you have any trouble.

Thanks!

#4

Will do, thanks

#5

I committed it, do a cvs update...

#6

Status:needs review» fixed

Yep, that works great, thanks!

#7

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.