From: tjhunt Date: Tue, 6 Jun 2006 17:25:00 +0000 (+0000) Subject: Fix notices when you restore a course with an empty forum. Merged from MOODLE_16_STABLE. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c078b2527bda3a43a0174919dd0b7435804a7a6a;p=moodle.git Fix notices when you restore a course with an empty forum. Merged from MOODLE_16_STABLE. --- diff --git a/mod/forum/restorelib.php b/mod/forum/restorelib.php index a8471691db..1095b8dd1e 100644 --- a/mod/forum/restorelib.php +++ b/mod/forum/restorelib.php @@ -165,7 +165,11 @@ $status = true; //Get the discussions array - $subscriptions = $info['MOD']['#']['SUBSCRIPTIONS']['0']['#']['SUBSCRIPTION']; + if (!empty($info['MOD']['#']['SUBSCRIPTIONS'])) { + $subscriptions = $info['MOD']['#']['SUBSCRIPTIONS']['0']['#']['SUBSCRIPTION']; + } else { + $subscriptions = array(); + } //Iterate over subscriptions for($i = 0; $i < sizeof($subscriptions); $i++) { @@ -222,7 +226,11 @@ $status = true; //Get the discussions array - $discussions = $info['MOD']['#']['DISCUSSIONS']['0']['#']['DISCUSSION']; + if (!empty($info['MOD']['#']['DISCUSSIONS'])) { + $discussions = $info['MOD']['#']['DISCUSSIONS']['0']['#']['DISCUSSION']; + } else { + $discussions = array(); + } //Iterate over discussions for($i = 0; $i < sizeof($discussions); $i++) { @@ -323,7 +331,11 @@ $status = true; //Get the read array - $readposts = $info['MOD']['#']['READPOSTS']['0']['#']['READ']; + if (!empty($info['MOD']['#']['READPOSTS'])) { + $readposts = $info['MOD']['#']['READPOSTS']['0']['#']['READ']; + } else { + $readposts = array(); + } //Iterate over readposts for($i = 0; $i < sizeof($readposts); $i++) {