|
Yet more info.... This is an example of the SQL that generates that recordset...
SELECT username,firstname,lastname ,ra.roleid, ra.depth FROM (SELECT u.id as userid, ra.roleid, So it's possibly what gets passed into get_users_by_capability() in the $fields parameter that's the problem? Sorry... more info... the call path leads back to the constructor for this class...
class admin_setting_users_with_capability in adminlib.php. The change in question (by Tim) is here: http://cvs.moodle.org/moodle/lib/adminlib.php?r1=1.153.2.57&r2=1.153.2.58 Adding id to the list of fields seems to fix it. I have no idea what this is all for so I am reluctant to commit this myself Ah right. That is a new admin_setting class that I wrote recently, and I screwed up by trying to limit the list of fields too much. Yes, adding id to the list of fields is the correct fix. has_cap requires it.
However, the problem only occurs in the more complex branch of the code which is used when there are negative permissions like PREVENT and PROHIBIT, which is more rarely used, which is probably why other people have not seen this. Acutally, we should check that u.id is in the list of fields, and if not display a nice error if not. I'll fix it.
tjhunt committed 1 file to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 14/Jan/09 01:45 PM
tjhunt committed 1 file to 'Moodle CVS' - 14/Jan/09 01:45 PM
Tim Hunt made changes - 14/Jan/09 01:46 PM
hi,
i update today (20090115) my moodle 1.9.3 to 1.9.3+ (build 20090114) i've got this error after the update : Notice: Undefined property: stdClass::$id in /moodle/lib/accesslib.php on line 4727 i read your report but don't understand what i have to do to fix this bug ... please can you tell me more ? thanks Muriel, the simplest way to fix your problem would be to update to the latest stable version of Moodle 1.9.3+ from http://download.moodle.org/
Howard, thanks for reporting this issue and Tim, thanks for fixing it.
Helen Foster made changes - 21/Jan/09 04:58 PM
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
stdClass Object
(
[username] => guest
[firstname] => Guest User
[lastname] =>
[roleid] =>
[depth] =>
)