NOBUG wiki: Fixing wiki_scale_used_anywhere()
Firstly, the conditions array was passed incorrectly. Secondly, the scale id would be probably saved as negative integer. Thirdly, the column does not exist in the new wiki yet.
This commit is contained in:
+7
-5
@@ -367,11 +367,13 @@ function wiki_scale_used($wikiid, $scaleid) {
|
||||
function wiki_scale_used_anywhere($scaleid) {
|
||||
global $DB;
|
||||
|
||||
if ($scaleid and $DB->record_exists('wiki', array('grade', $scaleid))) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
//if ($scaleid and $DB->record_exists('wiki', array('grade' => -$scaleid))) {
|
||||
// return true;
|
||||
//} else {
|
||||
// return false;
|
||||
//}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user