Moodle 2.9 courses broken until restored - PHP Programming error

Moodle 2.9 courses broken until restored - PHP Programming error

by Mark Rosthorn -
Number of replies: 0

A student/teacher trying to access a course they are enrolled on get a PHP Programming error message - on debug message below..

....

Debug info: Argument 2 passed to load_course_context() must be an instance of context_course, instance of context_system given, called in [dirroot]/lib/accesslib.php on line 492 and defined

Error code: codingerror

Stack trace:

line 393 of /lib/setuplib.php: coding_exception thrown

line 921 of /lib/accesslib.php: call to default_error_handler()

line 492 of /lib/accesslib.php: call to load_course_context()

line 1934 of /lib/modinfolib.php: call to has_capability()

line 1891 of /lib/modinfolib.php: call to cm_info->is_user_access_restricted_by_capability()

line 1818 of /lib/modinfolib.php: call to cm_info->update_user_visible()

line 1290 of /lib/modinfolib.php: call to cm_info->obtain_dynamic_data()

line 1162 of /lib/modinfolib.php: call to cm_info->get_name()

line 1885 of /lib/navigationlib.php: call to cm_info->__get()

line 1924 of /lib/navigationlib.php: call to global_navigation->generate_sections_and_activities()

line 449 of /course/format/lib.php: call to global_navigation->load_generic_course_sections()

line 151 of /course/format/weeks/lib.php: call to format_base->extend_course_navigation()

line 1839 of /lib/navigationlib.php: call to format_weeks->extend_course_navigation()

line 1204 of /lib/navigationlib.php: call to global_navigation->load_course_sections()

line 3110 of /lib/navigationlib.php: call to global_navigation->initialise()

line 824 of /lib/pagelib.php: call to navbar->has_items()

line 26 of /theme/leatherbound/layout/general.php: call to moodle_page->has_navbar()

line 1015 of /lib/outputrenderers.php: call to include()

line 945 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()

line 244 of /course/view.php: call to core_renderer->header()

-------------------

The admin can get into course but any other role can't and gets same error message.

When course backed up and then restored all works fine again.

Read about repairing all contexts by running a cli script but I'm too worried I'll break something.

Please help..

Platform Linux Ubuntu 14 

MYSQL 5.5.53

PHP 5.5.9.1.4.20

Moodle 2.9+ (Build: 20150625)



Average of ratings: -