If the course_category database in moodle have a course_category which is your own parent (course_category->parent=course_category_id)
moodle do an infinite loops trying to build course_category tree, and consumig all memory in the server.
i suggest to avoid this add a line in lib/datalib.php
on the function get_categories
in the foreach (line 802):
foreach ($categories as $key => $category) {
if (!$category->visible) {
if (!$creator)
}
}
chage to:
foreach ($categories as $key => $category) {
if (!$category->visible) {
if (!$creator) { unset($categories[$key]); }
}
//Changed code
if ($category->id==$category->parent) unset($categories[$key]);
}
- has been marked as being related by
-
MDL-13531 course category having self as parent
-
- Closed
-