Permalink
Browse files

MDL-25980 MNet: missing remotecourseid parameter in SQL clearing stal…

…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...
1 parent 4841fda commit 34685a59924c2463fe152796cabcd1312d686104 @mudrd8mz mudrd8mz committed Jan 14, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 mnet/service/enrol/locallib.php
@@ -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);
}

0 comments on commit 34685a5

Please sign in to comment.