With the Profile2 module installed, users may be merged which do not have profiles or do not have profiles with all the currently-defined fields present in the particular user(s) profile(s).

When a user is created by the UI, at least with the Profile2 configuration I'm using, all profiles are defined and all fields are present but have empty values. If a user is created programmatically or is created manually when the current profile2 configuration isn't defined, a profile may be missing. I also suspect (but haven't confirmed) that adding a field to a profile will not cause profile2 to return an empty field for it for a pre-exisiting user.

There is code which handles some but not all cases. The merge option in particular is not well protected against missing data. The effect may be a loss of profile2 data after the merge.

This is a somewhat different issue from the related issue, where the error seems to be occuring much earlier, before the merge specification is defined by the user.

Comments

DanChadwick created an issue. See original summary.

danchadwick’s picture

Status: Active » Fixed
StatusFileSize
new2.57 KB

Profile2 user merge will now create profiles if needed in all cases and will check for missing fields during merge option. In cases where the profile is freshly-created, there are no fields (i.e. the field keys are missing from the profile object).

  • DanChadwick committed 2fe4400 on 7.x-2.x
    Issue #2961130 by DanChadwick: Failure to merge when profile or profile...

Status: Fixed » Closed (fixed)

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