After deleting a course and returning to the course management page I encountered the following error...
Notice: Undefined offset: 3 in D:\xampp\htdocs\master_integration\lib\coursecatlib.php on line 1433
|
|
Coding error detected, it must be fixed by a programmer: PHP catchable fatal error
|
|
More information about this error
|
Debug info: Argument 1 passed to course_in_list::__construct() must be an instance of stdClass, null given, called in [dirroot]\lib\coursecatlib.php on line 1433 and defined
|
Error code: codingerror
|
Stack trace:
|
|
line 393 of \lib\setuplib.php: coding_exception thrown
|
line 2644 of \lib\coursecatlib.php: call to default_error_handler()
|
line 1433 of \lib\coursecatlib.php: call to course_in_list->__construct()
|
line 517 of \course\classes\management_renderer.php: call to coursecat->get_courses()
|
line 497 of \course\management.php: call to core_course_management_renderer->course_listing()
|
I added a bit of debugging code around where the error was happening. It seems that there was an id for the course I had just deleted still in the cache, even though there was no longer a course record in the DB...
Array
|
(
|
[0] => 3
|
[1] => 2
|
)
|
|
Array
|
(
|
[2] => stdClass Object
|
(
|
[id] => 2
|
[category] => 1
|
[sortorder] => 10001
|
[shortname] => Master Integration (SQLSVR) 101
|
[fullname] => Master Integration (SQLSVR) 101
|
[idnumber] =>
|
[startdate] => 1375372800
|
[visible] => 1
|
[cacherev] => 1384920126
|
[hassummary] =>
|
[ctxid] => 29
|
[ctxpath] => /1/3/29
|
[ctxdepth] => 3
|
[ctxlevel] => 50
|
[ctxinstance] => 2
|
)
|
|
)
|
Purging caches removed the error.
- duplicates
-
MDL-42509 Deleting a course doesn't purge caches
-
- Closed
-