mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-18293 $DB->something is using exceptions, no need for ifs there, removing useless strings
This commit is contained in:
parent
7826abc79f
commit
2a7eff41ad
8 changed files with 30 additions and 59 deletions
|
@ -79,10 +79,9 @@ function glossary_add_instance($glossary) {
|
|||
print_error('unknowformat', '', '', $glossary->displayformat);
|
||||
}
|
||||
|
||||
if ($returnid = $DB->insert_record("glossary", $glossary)) {
|
||||
$glossary->id = $returnid;
|
||||
glossary_grade_item_update($glossary);
|
||||
}
|
||||
$returnid = $DB->insert_record("glossary", $glossary);
|
||||
$glossary->id = $returnid;
|
||||
glossary_grade_item_update($glossary);
|
||||
|
||||
return $returnid;
|
||||
}
|
||||
|
@ -127,12 +126,11 @@ function glossary_update_instance($glossary) {
|
|||
print_error('unknowformat', '', '', $glossary->displayformat);
|
||||
}
|
||||
|
||||
if ($return = $DB->update_record("glossary", $glossary)) {
|
||||
if ($glossary->defaultapproval) {
|
||||
$DB->execute("UPDATE {glossary_entries} SET approved = 1 where approved <> 1 and glossaryid = ?", array($glossary->id));
|
||||
}
|
||||
glossary_grade_item_update($glossary);
|
||||
$return = $DB->update_record("glossary", $glossary);
|
||||
if ($glossary->defaultapproval) {
|
||||
$DB->execute("UPDATE {glossary_entries} SET approved = 1 where approved <> 1 and glossaryid = ?", array($glossary->id));
|
||||
}
|
||||
glossary_grade_item_update($glossary);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue