Installation help

 
 
Picture of Kevin Ramsey
Course enrollment in 2.4
 

After upgrading from 2.3 to 2.4.1 (Win2008R2 Server; IIS7; MSSQL 2008R2; FastCGI) all seemed well until I clicked on the course enrollment options for some of my courses. The action (Course-Users-enrolled users) returns error message:

"coding error detected, it must be fixed by a programmer. Invalid context id specified context::instance_by_id()"

In my other courses I can get user details with no problem. I can see nothing in the course edit details to suggest why the error triggers.

 
Average of ratings: -
Picture of Dave Pacione
Re: Course enrollment in 2.4
 

I'm having the same problem in Moodle 2.5.1+ (Build: 20130808)Version 2013051401.08 on the same server configuration as above.

Debug info: Error code: codingerror
Stack trace:

line 5178 of \lib\accesslib.php: coding_exception thrown

line 49 of \enrol\cohort\lib.php: call to context::instance_by_id()

line 506 of \enrol\locallib.php: call to enrol_cohort_plugin->get_instance_name()

line 152 of \enrol\users_forms.php: call to course_enrolment_manager->get_enrolment_instance_names()

line 191 of \lib\formslib.php: call to enrol_users_filter_form->definition()

line 205 of \enrol\users.php: call to moodleform->moodleform()

 

Output buffer: Notice: Trying to get property of non-object in D:\inetpub\moodle_dev\enrol\cohort\lib.php on line 49 Notice: Trying to get property of non-object in D:\inetpub\moodle_dev\enrol\cohort\lib.php on line 49
 
line 49 of enrol\cohort\lib.php is:
 
$cohortname = format_string($cohort->name, true, array('context'=>context::instance_by_id($cohort->contextid)));

This only occurs for a few courses but I can't see what's different about them compared to the courses that don't have a problem

Any ideas would be very much appreciated

 
Average of ratings: -