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.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | profile.module_21.patch | 1.19 KB | tenrapid |
#1 | profile.module_20.patch | 1.19 KB | tenrapid |
Comments
Comment #1
tenrapid CreditAttribution: tenrapid commentedHere 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.
Comment #2
kkaefer CreditAttribution: kkaefer commented+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.
Comment #3
tenrapid CreditAttribution: tenrapid commentedThe 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.Comment #4
Steven CreditAttribution: Steven commentedCommitted to HEAD, thanks.
Comment #5
(not verified) CreditAttribution: commented