Details
Description
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) {
unset($categories[$key]);
}
}
}
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]);
}
Issue Links
| This issue has been marked as being related by: | ||||
| MDL-13531 | course category having self as parent |
|
|
|
Activity
- All
- Comments
- History
- Activity
- Source
- Test Sessions
rewritten code does not have this problem anymore
thanks for the report