mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-18818 - don't define var if already defined - happens when these functions are called more than once at a time.
This commit is contained in:
parent
4f76747307
commit
062173b09b
1 changed files with 6 additions and 2 deletions
|
@ -498,7 +498,9 @@
|
||||||
global $CFG,$SESSION,$USER, $DB; // is there such a thing on cron? I guess so..
|
global $CFG,$SESSION,$USER, $DB; // is there such a thing on cron? I guess so..
|
||||||
global $restore; // ick
|
global $restore; // ick
|
||||||
|
|
||||||
define('RESTORE_SILENTLY',true); // don't output all the stuff to us.
|
if (!defined('RESTORE_SILENTLY')) {
|
||||||
|
define('RESTORE_SILENTLY',true); // don't output all the stuff to us.
|
||||||
|
}
|
||||||
|
|
||||||
$debuginfo = 'import_backup_file_silently: ';
|
$debuginfo = 'import_backup_file_silently: ';
|
||||||
$cleanupafter = false;
|
$cleanupafter = false;
|
||||||
|
@ -618,7 +620,9 @@
|
||||||
*/
|
*/
|
||||||
function backup_course_silently($courseid, $prefs, &$errorstring) {
|
function backup_course_silently($courseid, $prefs, &$errorstring) {
|
||||||
global $CFG, $preferences, $DB; // global preferences here because something else wants it :(
|
global $CFG, $preferences, $DB; // global preferences here because something else wants it :(
|
||||||
define('BACKUP_SILENTLY', 1);
|
if (!defined('BACKUP_SILENTLY')) {
|
||||||
|
define('BACKUP_SILENTLY', 1);
|
||||||
|
}
|
||||||
if (!$course = $DB->get_record('course', array('id'=>$courseid))) {
|
if (!$course = $DB->get_record('course', array('id'=>$courseid))) {
|
||||||
debugging("Couldn't find course with id $courseid in backup_course_silently");
|
debugging("Couldn't find course with id $courseid in backup_course_silently");
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue