If you have several users and custom profile fields, and view the user listing (/profile), these values aren't displayed correctly. If a user does *not* have set a certain value, the value of the preceding user is shown instead - the values "fall through", thus aren't reset correctly in a loop.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tenrapid’s picture

Status: Active » Needs review
FileSize
1.19 KB

Here is a patch.

The field array in profile_browse() obviously contains references to the field objects. So we let _profile_update_user_fields() set even empty values.

kkaefer’s picture

+1 for this patch. Solves the issue. Code makes sense to me ($fields, which should just contain the available fields, has been overwritten in the loop with an object that is filled with actual values). However, it would be nice if you'd explain the second change in this patch.

tenrapid’s picture

FileSize
1.19 KB

The second part of the patch changes _profile_update_user_fields() so that if a user has not set a certain field, this field's value is explicitly set to NULL. This is neccessary because there are only references to the field objects passed around.

Steven’s picture

Status: Needs review » Fixed

Committed to HEAD, thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)