]> git.mjollnir.org Git - moodle.git/commitdiff
Handle properly in restore the change data->notification from NULL to NOT NULL. MDL...
authorstronk7 <stronk7>
Thu, 15 May 2008 22:34:52 +0000 (22:34 +0000)
committerstronk7 <stronk7>
Thu, 15 May 2008 22:34:52 +0000 (22:34 +0000)
mod/data/restorelib.php

index a0ae7dafd8b79261e2e1fb59e8948dfada19ebf0..0da5bf67314e45d347ef12165dbd10b0e74c20ce 100644 (file)
@@ -96,6 +96,9 @@ function data_restore_mods($mod,$restore) {
         $database->defaultsortdir = backup_todb($info['MOD']['#']['DEFAULTSORTDIR']['0']['#']);
         $database->editany = backup_todb($info['MOD']['#']['EDITANY']['0']['#']);
         $database->notification = backup_todb($info['MOD']['#']['NOTIFICATION']['0']['#']);
+        if ($database->notification == null) { /// Changed to NOT NULL between 1.9 and 2.0 - MDL-14548
+            unset($database->notification);    /// Unset it if null to get proper Moodle 2.0 default (0) applied
+        }
 
         $newid = insert_record ('data', $database);
 
@@ -725,4 +728,4 @@ function data_decode_content_links_caller($restore) {
     return $status;
 }
 
-?>
\ No newline at end of file
+?>