Skip to content

Commit

Permalink
MDL-25980 MNet: missing remotecourseid parameter in SQL clearing stal…
Browse files Browse the repository at this point in the history
…e cache records

Because the remotecourseid parameter was missing in SQL, all cache
records for other courses from that host were cleared.
  • Loading branch information
mudrd8mz committed Jan 14, 2011
1 parent 4841fda commit 34685a5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mnet/service/enrol/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,12 @@ public function req_course_enrolments($mnethostid, $remotecourseid) {

// prune stale enrolment records
if (empty($list)) {
$DB->delete_records('mnetservice_enrol_enrolments', array('hostid'=>$mnethostid));
$DB->delete_records('mnetservice_enrol_enrolments', array('hostid'=>$mnethostid, 'remotecourseid'=>$remotecourseid));
} else {
list($isql, $params) = $DB->get_in_or_equal(array_keys($list), SQL_PARAMS_NAMED, 'param0000', false);
$params['hostid'] = $mnethostid;
$select = "hostid = :hostid AND id $isql";
$params['remotecourseid'] = $remotecourseid;
$select = "hostid = :hostid AND remotecourseid = :remotecourseid AND id $isql";
$DB->delete_records_select('mnetservice_enrol_enrolments', $select, $params);
}

Expand Down

0 comments on commit 34685a5

Please sign in to comment.