Skip to content

Commit

Permalink
fixed some notices in scheduled backup; merged from MOODLE_16_STABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Aug 21, 2006
1 parent 5cf36b3 commit a239223
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions backup/backuplib.php
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,8 @@ function backup_general_info ($bf,$preferences) {
fwrite ($bf,full_tag("INCLUDED",4,false,$included));
fwrite ($bf,full_tag("USERINFO",4,false,$userinfo));

if (is_array($preferences->mods[$element->name]->instances)
if (isset($preferences->mods[$element->name]->instances)
&& is_array($preferences->mods[$element->name]->instances)
&& count($preferences->mods[$element->name]->instances)) {
fwrite ($bf, start_tag("INSTANCES",4,true));
foreach ($preferences->mods[$element->name]->instances as $id => $object) {
Expand Down Expand Up @@ -1239,7 +1240,8 @@ function backup_log_info($bf,$preferences) {
//See if it is a valid module to backup
if ($log->module == "course" or
$log->module == "user" or
$preferences->mods[$log->module]->backup == 1) {
(array_key_exists($log->module, $preferences->mods) and $preferences->mods[$log->module]->backup == 1)) {
// logs with 'upload' in module field are ignored, there is no restore code anyway
//Begin log tag
fwrite ($bf,start_tag("LOG",3,true));

Expand Down Expand Up @@ -1661,7 +1663,8 @@ function backup_module($bf,$preferences,$module) {

require_once($CFG->dirroot.'/mod/'.$module.'/backuplib.php');

if (is_array($preferences->mods[$module]->instances)) {
if (isset($preferences->mods[$module]->instances)
&& is_array($preferences->mods[$module]->instances)) {
$onemodbackup = $module.'_backup_one_mod';
if (function_exists($onemodbackup)) {
foreach ($preferences->mods[$module]->instances as $instance => $object) {
Expand Down

0 comments on commit a239223

Please sign in to comment.