Download & Extend

advuser doesn't look for "hidden" profile fields

Project:Advanced User
Version:6.x-3.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:earnie
Status:closed (fixed)

Issue Summary

I'd really like advuser to ook for profile fields when the fields are set as "Hidden profile field, only accessible by administrators, modules and themes."

Comments

#1

I'd like to have this functionality also. Has any work been done on this? If I knew more PHP, I'd volunteer, but I am a total newbie.

#2

Not a real patch I know, but here's what you can do manually do get access to these fields:

change the code beginning on line 754

<?php
    $fields
= array();
   
$result = db_query('SELECT * FROM {profile_fields} WHERE visibility != %d ORDER BY category, weight', PROFILE_HIDDEN);
    while (
$row = db_fetch_object($result)) {
     
$fields[$row->fid] = $row->title;
    }
?>

into

<?php
   
    $fields
= array();
   
$sql = 'SELECT * FROM {profile_fields}';
    if (!
user_access('administer users')) {
     
$filters[] = ' visibility != %d';
     
$args[] = PROFILE_HIDDEN;
    }
    if (
count($filters) > 0) {
     
$sql .= ' WHERE' . implode(' AND ', $filters);
    }
   
$sql .= ' ORDER BY category, weight';
   
$result = db_query($sql, $args);
    while (
$row = db_fetch_object($result)) {
     
$fields[$row->fid] = $row->title;
    }
?>

#3

Version:4.7.x-1.x-dev» master
Status:active» needs review

Thanks saul11!

I don't blame you for not making a patch. It's hard to tell which version it should be applied against.

Here's a patch to apply against the HEAD version. I haven't tested this yet, but I'm hoping that this can be reviewed and rolled into the 5.x version.

AttachmentSize
advuser_hiddenfields_92808.patch 733 bytes

#4

Assigned to:Anonymous» earnie

#5

Status:needs review» postponed

#6

Version:master» 6.x-3.x-dev
Status:postponed» active

#7

Status:active» fixed

Somewhere between then and now the code has changed where the visibility isn't considered at all. Since the profile_fields are considered by the site administrator when selecting profile fields to use for filtering it makes since to have removed the visibility completely.

#8

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here