Browse files

Bug fixed:

- Updating a Default Approval Status from NO to YES in a glossary, now approve automatically all entries waiting for approval.
  • Loading branch information...
1 parent f303b36 commit 5eaa2d34683260962453108f71617bddefc21012 willcast committed Oct 31, 2003
Showing with 6 additions and 3 deletions.
  1. +6 −3 mod/glossary/lib.php
View
9 mod/glossary/lib.php
@@ -41,17 +41,20 @@ function glossary_update_instance($glossary) {
/// Given an object containing all the necessary data,
/// (defined by the form in mod.html) this function
/// will update an existing instance with new data.
-
+global $CFG;
if ( !isadmin() ) {
unset($glossary->globalglossary);
}
$glossary->timemodified = time();
$glossary->id = $glossary->instance;
- # May have to add extra stuff in here #
+ $return = update_record("glossary", $glossary);
+ if ($return and $glossary->defaultapproval) {
+ execute_sql("update {$CFG->prefix}glossary_entries SET approved = 1 where approved != 1 and glossaryid = " . $glossary->id,false);
+ }
- return update_record("glossary", $glossary);
+ return $return;
}

0 comments on commit 5eaa2d3

Please sign in to comment.