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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Patrick Nelson’s picture

So, I assume that this is just me then?

Patrick Nelson’s picture

Version: x.y.z » 4.7.0-beta6
Priority: Normal » Critical

I'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).

dww’s picture

Assigned: Unassigned » dww
Status: Active » Needs review
FileSize
1.29 KB

i'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

dww’s picture

i 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

killes@www.drop.org’s picture

Status: Needs review » Needs work

Simpyl using an array index will throw warnings in php5, I think. Prefix the usage by isset($array['field']) &&

dww’s picture

Status: Needs work » Needs review
FileSize
1.36 KB

i use php4 everywhere... thanks for the heads-up on compatibility issues!

new version attached with isset().

dww’s picture

whoops, i went backwards on the " problem. sorry about that. here's the (hopefully final, RTBC) patch.

killes@www.drop.org’s picture

Priority: Critical » Normal
Status: Needs review » Fixed

applied

Anonymous’s picture

Status: Fixed » Closed (fixed)