Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
profile.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Oct 2008 at 12:23 UTC
Updated:
16 Nov 2008 at 16:17 UTC
when viewing the profile page without further arguments (that is, viewing 'http://example/com/profile' with non-admin users, an error is thrown:
notice: Undefined property: stdClass::$visibility in /var/www/d7/modules/profile/profile.module on line 287.
This is because on profile.pages.inc the $field object is constructed out of a SELECT query without the visibility. In the patch it is added (i guess using SELECT * can be used as well)
| Comment | File | Size | Author |
|---|---|---|---|
| profile_browse.patch | 910 bytes | Ozeuss |
Comments
Comment #1
Ozeuss commentedComment #2
Ozeuss commentedComment #3
dries commentedI can't seem to reproduce this problem, nor can I seem to trace down the problem to the function that you patched. Care to provide some more information, or maybe a simpletest to go with this? Thanks.
Comment #4
Ozeuss commentedYes, of course.
This notice is thrown only when viewing this page with users that do not have 'administer users' privileges, and only on the "example.com/profile" page (which shows the user list).
The chain is like this :
profile_browse is the menu callback in charge of showing this page, which makes the a query (the patched one) and issues a call to _profile_update_user_fields($fields, $account).
_profile_update_user_fields in turn calls profile_view_field, which is the source of the notice, due to the line
Since the original query does not SELECT the visibilty field, it is non-existent.
if the user has the correct permissions, the notice is 'escaped'.
Comment #5
dries commentedYou're right. Committed to CVS HEAD. Thanks!