Custom admin roles get white page when browsing userlist in Moodle 2.0

Custom admin roles get white page when browsing userlist in Moodle 2.0

by Mike Kelly -
Number of replies: 2

Hi all,

We're running Moodle 2.0 (build 20101130) on a trial server and our helpdesk staff have noticed a problem. When they attempt to browse the list of users, they get a blank white page. Viewing source on the resultant page shows absolutely no content whatsoever. The helpdesk staff have their own role defined, which has the rights to admin user accounts.

After turning on debugging, I found this in the error log after each browse attempt:

PHP Fatal error:  Call to undefined function make_categories_list() in /var/www/moodle/html/user/filters/courserole.php on line 36

For some reason, it seems that the make_categories_list() function is undefined for users with our Help Desk role, but defined for Admins. Doing some digging, it looks like make_categories_list() is defined in course/lib.php

So I added the following require statement to the PHP file where the error occurred:

at top of courserole.php:

require_once($CFG->dirroot . '/course/lib.php');

This appears to have fixed the problem. But my question is why does this error only happen for non-admin roles? Obviously, the function is being included for admins somewhere along the line.

While we are running an older build of 2.0, I haven't seen anything in moodle-latest to indicate the problem has been fixed. Any suggestions as to why this might be happening and whether or not there's a better way to fix it?

Average of ratings: -
In reply to Mike Kelly

Re: Custom admin roles get white page when browsing userlist in Moodle 2.0

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Mike,

I came across a report of your problem in the Moodle Tracker - MDL-26221. As the status is 'In Progress', it's likely that the bug will soon be fixed.

In reply to Helen Foster

Re: Custom admin roles get white page when browsing userlist in Moodle 2.0

by Mike Kelly -

That looks like it. I missed that report when I looked at the tracker - thanks!