MDL-43230 badges: manually revoke awarded badges

A user can be manually awarded a badge, but if given by mistake an
awarded badge cannot be removed.
This commit is contained in:
Matt Davidson
2016-10-12 05:06:38 +00:00
committed by Ryan Wyllie
parent d9520bc04e
commit b7374faca6
11 changed files with 292 additions and 31 deletions
+5 -1
View File
@@ -73,7 +73,11 @@ class core_badges_assertion {
WHERE ' . $DB->sql_compare_text('bi.uniquehash', 40) . ' = ' . $DB->sql_compare_text(':hash', 40),
array('hash' => $hash), IGNORE_MISSING);
$this->_url = new moodle_url('/badges/badge.php', array('hash' => $this->_data->uniquehash));
if ($this->_data) {
$this->_url = new moodle_url('/badges/badge.php', array('hash' => $this->_data->uniquehash));
} else {
$this->_url = new moodle_url('/badges/badge.php');
}
}
/**