-
Bug
-
Resolution: Fixed
-
Critical
-
3.9.2
-
-
MOODLE_39_STABLE
-
MOODLE_39_STABLE
-
Moodle App 3.9.3
The app calls core_filters_get_available_in_context to request information about all the activity contexts on a course. If there are a large number of activities on the course, this can hit the PHP input variable limit because there are a large number of parameters in the request (2 per context). Here is an example $_REQUEST object:
Array
(
[moodlewsrestformat] => json
[wsfunction] => core_filters_get_available_in_context
[contexts] => Array
(
[0] => Array
(
[contextlevel] => module
[instanceid] => 1605576
)
(....lots of entries omitted…)
[499] => Array
(
[contextlevel] => module
[instanceid] => 1606071
)
[500] => Array
(
[contextlevel] => module
)
)
)
In the above example, entry 500 only had half the data, there should have been other entries after 500, and the final 'wstoken' value has been chopped off, because the PHP max_input_vars setting on the server (set to default, 1000) has been exceeded.
The request fails due to invalid token (since it wasn't supplied), which can cause the user to be prompted to log in again.
The app should probably make this request in batches if there is a very large number (e.g. > 400).