Skip to content

Commit

Permalink
MDL-12160, do not force context creation when calling get_coursemodul…
Browse files Browse the repository at this point in the history
…e_info() as context_rel table might not exist yet
  • Loading branch information
toyomoyo committed Nov 15, 2007
1 parent da76b7e commit dcc09c5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mod/assignment/lib.php
Expand Up @@ -2351,9 +2351,13 @@ function assignment_get_coursemodule_info($coursemodule) {

require_once("$CFG->dirroot/mod/assignment/type/$assignment->assignmenttype/assignment.class.php");
$assignmentclass = "assignment_$assignment->assignmenttype";
$ass = new $assignmentclass($coursemodule->id, $assignment);

return $ass->get_coursemodule_info($coursemodule);

// MDL-12160, get_coursemodule should not touch context_creation code as the function is called during upgrade
// prior to creation of context_rel table
return call_user_func(array($assignmentclass, 'get_coursemodule_info'), $coursemodule);

//$ass = new $assignmentclass($coursemodule->id, $assignment);
//return $ass->get_coursemodule_info($coursemodule);
}


Expand Down

0 comments on commit dcc09c5

Please sign in to comment.