-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
3.9.1, 3.11.5
-
None
-
2019120300
-
MOODLE_311_STABLE, MOODLE_39_STABLE
Hi all
We've encountering a problem editing a slot, if a huge amount of students are enrolled in the course and there are a lot of appointments.
This is the PHP error message:
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /<MOODLEDIR>/lib/moodlelib.php on line 9423, referer: https://FQDN/mod/scheduler/view.php?id=<ID> |
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /<MOODLEDIR>/lib/classes/session/handler.php on line 54, referer: https://FQDN/mod/scheduler/view.php?id=<ID> |
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in Unknown on line 0, referer: https://FQDN/mod/scheduler/view.php?id=<ID> |
We've this setup which leads to this error:
- memory_limit: 512M
- students in course: 3206
- appointments: 38 (max. 40)
We could increase the PHP memory_limit but this is not the right solution. So we analzed the issue and can sumarry following:
- The `searchableselector` is always populated with this huge array of options (studentchoices) (https://github.com/bostelm/moodle-mod_scheduler/blob/master/slotforms.php#L259).
- This element will be rendered in each appointment group with the core function `repeat_elements` (https://github.com/bostelm/moodle-mod_scheduler/blob/master/slotforms.php#L309).
So we think, that we must solve this issue with AJAX calls, so that it will be similar to the `course` and `tags` sublcasses of the `autocomplete` element (https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#autocomplete).
What do you think?