advuser doesn't look for "hidden" profile fields
Christefano - November 3, 2006 - 21:29
| Project: | Advanced User |
| Version: | HEAD |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | earnie |
| Status: | postponed |
Description
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."

#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
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.
#4
#5