Browse Source

Merge pull request #15 from tlock/master

Fix capability upgrade issues for Attendance
MOODLE_26_STABLE
Dan Marsden 11 years ago
parent
commit
f561d065c9
  1. 7
      locallib.php

7
locallib.php

@ -1438,6 +1438,13 @@ function attforblock_upgrade() {
WHERE itemmodule = ?"; WHERE itemmodule = ?";
$DB->execute($sql, array('attendance', 'attforblock')); $DB->execute($sql, array('attendance', 'attforblock'));
// Now convert role capabilities to 'attendance'
$sql = "UPDATE {role_capabilities}
SET capability = REPLACE(capability, ?, ?)
WHERE " . $DB->sql_like('capability', '?');
$params = array("mod/attforblock:", "mod/attendance:", "mod/attforblock:%");
$DB->execute($sql, $params);
// Clear cache for courses with attendances. // Clear cache for courses with attendances.
$attendances = $DB->get_recordset('attendance', array(), '', 'course'); $attendances = $DB->get_recordset('attendance', array(), '', 'course');
foreach ($attendances as $attendance) { foreach ($attendances as $attendance) {

Loading…
Cancel
Save