When looking at http://example.com/profile - which gives you a list of users, you should see fields that where defined to have pages as links to a list of members with the same valie of this field, as in http://drupal.org/profile/interest/peace .
In drupal 4.7.3, the query doesn't fetch the "page" column, making it unavailable to the condition to be checked later on:
Query before the fix (line 470 in profile.module,v 1.154.2.1) - the column "page" is absent:
// Compile a list of fields to show.
$fields = array();
$result = db_query('SELECT name, title, type, weight FROM {profile_fields} WHERE visibility = %d ORDER BY category, weight', PROFILE_PUBLIC_LISTINGS);
while ($record = db_fetch_object($result)) {
$fields[] = $record;
}
Here is the condition that is checked (line 526):
$browse = user_access('access user profiles')
&& (user_access('administer users') || $field->visibility != PROFILE_PRIVATE)
&& !empty($field->page);
So all is needed is to add the page column to the query in line 472:
$result = db_query('SELECT name, title, type, weight, page FROM {profile_fields} WHERE visibility = %d ORDER BY category, weight', PROFILE_PUBLIC_LISTINGS);
And the users lists work as it should!
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | profile.field-page-list.patch.txt | 1.37 KB | Robrecht Jacques |
| #3 | profile_fixed_listings.patch | 65.58 KB | z.stolar |
Comments
Comment #1
z.stolar commentedSame goes for the query on line 419.
Comment #2
drummThere is no patch file here. See http://drupal.org/diffandpatch.
Comment #3
z.stolar commentedOK - I attach a patch, made after following the instructions in the link above. I hope the output is satisfying.
Comment #4
Robrecht Jacques commentedPatch rerolled for 4.7.
Comment #5
Robrecht Jacques commentedReview:
- without patch : a profile field that is "Public field, content shown on profile page and on member list pages." and has a "Page title" will display the field value on /profile, but without link to the page with all users with this field value (/profile/profile_field/value).
- with patch : this is fixed.
Don't see any side-effects.
Comment #6
Robrecht Jacques commentedWas fixed exactly like this in drupal head/5.0: http://drupal.org/node/69228 .
Comment #7
killes@www.drop.org commentedapplied
Comment #8
(not verified) commented