Moodle

bad error checking in backup_module backuplib.php

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Duplicate
  • Affects Version/s: 1.9
  • Fix Version/s: None
  • Component/s: Backup
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

thanks to Sam Marshall for details regarding this bug.

backup_module in backuplib.php these lines:

foreach ($preferences->mods[$module]->instances as
$instance => $object) {
if (!empty($object->backup)) { $status = $onemodbackup($bf,$preferences,$instance); }
}

overwrite the $status flag and doesn't notify about anything failing - should change to something like this (untested!)
foreach ($preferences->mods[$module]->instances as $instance => $object) {
if (!empty($object->backup)) {
$statusm = $onemodbackup($bf,$preferences,$instance);
if (!$statusm) { notify('backup of:'.$module.'-'.$instance.' failed.'); $status = false; }
}
}

--should also check to see if backup is silent and only notify when not silent, and should log an entry to backup_log

Dan

Issue Links

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: