diff --git a/locallib.php b/locallib.php index 28a081e..f377c18 100644 --- a/locallib.php +++ b/locallib.php @@ -1438,6 +1438,13 @@ function attforblock_upgrade() { WHERE itemmodule = ?"; $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. $attendances = $DB->get_recordset('attendance', array(), '', 'course'); foreach ($attendances as $attendance) {