mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Skipping empty categories in restore. They shouldn't exist but
I've received some examples of this these days. Merged from MOODLE_14_STABLE
This commit is contained in:
parent
1372b482df
commit
b5104c34f1
1 changed files with 10 additions and 7 deletions
|
@ -990,13 +990,16 @@
|
||||||
if ($info !== true) {
|
if ($info !== true) {
|
||||||
//Iterate over each category
|
//Iterate over each category
|
||||||
foreach ($info as $category) {
|
foreach ($info as $category) {
|
||||||
$catrestore = "quiz_restore_question_categories";
|
//Skip empty categories (some backups can contain them)
|
||||||
if (function_exists($catrestore)) {
|
if (!empty($category->id)) {
|
||||||
//print_object ($category); //Debug
|
$catrestore = "quiz_restore_question_categories";
|
||||||
$status = $catrestore($category,$restore);
|
if (function_exists($catrestore)) {
|
||||||
} else {
|
//print_object ($category); //Debug
|
||||||
//Something was wrong. Function should exist.
|
$status = $catrestore($category,$restore);
|
||||||
$status = false;
|
} else {
|
||||||
|
//Something was wrong. Function should exist.
|
||||||
|
$status = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue