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!

Comments

z.stolar’s picture

Same goes for the query on line 419.

drumm’s picture

Status: Needs review » Active

There is no patch file here. See http://drupal.org/diffandpatch.

z.stolar’s picture

Status: Active » Needs review
StatusFileSize
new65.58 KB

OK - I attach a patch, made after following the instructions in the link above. I hope the output is satisfying.

Robrecht Jacques’s picture

StatusFileSize
new1.37 KB

Patch rerolled for 4.7.

Robrecht Jacques’s picture

Review:
- 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.

Robrecht Jacques’s picture

Was fixed exactly like this in drupal head/5.0: http://drupal.org/node/69228 .

killes@www.drop.org’s picture

Status: Needs review » Fixed

applied

Anonymous’s picture

Status: Fixed » Closed (fixed)