Description

I've received some complains from some users on my production Moodle site (2.0.4+ (Build: 20110907)) saying that they are occasionally getting a "Coding error detected, it must be fixed by a programmer: PHP catchable fatal error" message when they use filters on the 'Browse list of users' page in Moodle:

Debug info: Argument 1 passed to textlib::asort() must be an array, null given, called in C:\Moodle\lib\moodlelib.php on line 5980 and defined

Stack trace:

line 359 of \lib\setuplib.php: coding_exception thrown

line 475 of \lib\textlib.class.php: call to default_error_handler()

line 5980 of \lib\moodlelib.php: call to textlib->asort()

line 109 of \user\filters\lib.php: call to core_string_manager->get_list_of_countries()

line 44 of \user\filters\lib.php: call to user_filtering->get_field()

line 116 of \admin\user.php: call to user_filtering->user_filtering()

The interesting thing is that it's completely random - it only happens occasionally. Most of the time users can use the 'Browse list of users' function without problems. I'm unable to easily reproduce the error easily - but it does appear that it gets triggered when users are using the advanced filters on that 'Browse list of users' page.

And it seems to sort itself out! After a few minutes users are again able to use that 'Browse list of users' function again.

Activity

A quick look at the area of code where the bug is reported seems to be getting a list of countries. It might be worth playing around with the current language to see if this has an effect. Without a set of replication steps, it's hard to fix such issues; not impossible, but hard.

Michael de Raadt
added a comment - 18/Jun/12 3:38 PM Thanks for reporting that.
A quick look at the area of code where the bug is reported seems to be getting a list of countries. It might be worth playing around with the current language to see if this has an effect. Without a set of replication steps, it's hard to fix such issues; not impossible, but hard.

Michael de Raadt
added a comment - 18/Jun/12 3:41 PM It might also be worth considering upgrading.
I noted that there has been a code change in this area since 2.0.x. If we are going to work on this now, it would need to be a problem with a supported version (at this stage: 2.1, 2.2 and 2.3).

Luis de Vasconcelos
added a comment - 18/Jun/12 7:59 PM Thanks.
Yes, replication is a bit difficult at the moment since it happens randomly - presumably when our teachers/admins are using filters to browse the list of users.
I only have one language pack installed, the default 'English (en)'.
The "Default language" list on the 'Site administration / Language / Language settings' only contains one option: 'English (en)'.
'Language autodetect' is not selected.
'Display language menu' is not selected.
'Languages on language menu' is blank.
'Cache language menu' is selected.
'Cache all language strings' is selected.
We have customised some of the language strings (approx 7 of them).
An upgrade is on the cards, but the upgrade from 2.0.4+ to 2.1 is crashing during the question bank / quiz attempts conversion, so there are issues to resolve there first...
If/when the "catchable" crash happpens again I'll play around with the 'Cache language menu' and 'Cache all language strings' options to see if they have any effect.

Hello. I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue.

Rajesh Taneja
added a comment - 17/May/13 1:12 AM Hello. I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue.
For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment
If you have any information about this issue or a possible fix please post it here