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.
Using latest Drupal cvs files (profile module = 1.142).
No matter what fields you select in admin/block/configure/profile/0
, the Author information block shows every field from the user profile.
Regards
Patrick
Comment | File | Size | Author |
---|---|---|---|
#7 | profile_author_block_obey_settings_3.patch | 1.36 KB | dww |
#6 | profile_author_block_obey_settings_2.patch | 1.36 KB | dww |
#4 | profile_author_block_obey_settings_1.patch | 1.29 KB | dww |
#3 | profile_author_block_obey_settings.patch | 1.29 KB | dww |
Comments
Comment #1
Patrick Nelson CreditAttribution: Patrick Nelson commentedSo, I assume that this is just me then?
Comment #2
Patrick Nelson CreditAttribution: Patrick Nelson commentedI've tested this on a clean install of latest Drupal-CVS and it still doesn't work so I'm changing this to critical because it makes the author information block unuseable (IMHO).
Comment #3
dwwi'm not sure i agree that this is critical, but i can definitely reproduce the bug, and i'm attaching a trivial (2 line) fix. basically, inside profile.module's profile_block() method, where we're deciding what fields to display when viewing the block, we're trying to compare the fields against the settings saved in the DB via the block config page you mentioned in your post. b/c these settings are checkboxes, we store an array of all the field names, with 0's as the value for unchecked fields, and the field name as the value for the checked ones. so, when we compared using in_array(), everything matched, since every possible field name is in the array. the solution is to just see if that particular field has a non-0 value in the array. look at the diff if this isn't clear...
enjoy,
-derek
Comment #4
dwwi just realized i was needlessly including " marks around $record->name when using it as an array index. the attached patch removes these (both versions work, this one is slightly better)...
i wonder if this bug was introduced by the FAPI conversion. are there other places we're storing a serialized array of checkboxes as a setting that in 4.6 used to only have entries for checked boxes, but in 4.7 has 0'ed entries for all boxes? i'd have to investigate more, but if anyone more familiar with core cared to comment, that'd be swell.
thanks,
-derek
Comment #5
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedSimpyl using an array index will throw warnings in php5, I think. Prefix the usage by isset($array['field']) &&
Comment #6
dwwi use php4 everywhere... thanks for the heads-up on compatibility issues!
new version attached with isset().
Comment #7
dwwwhoops, i went backwards on the " problem. sorry about that. here's the (hopefully final, RTBC) patch.
Comment #8
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedapplied
Comment #9
(not verified) CreditAttribution: commented