mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-23479 lesson backup - force order of pages to use prevpageid so that restore is able to see pages in the right order.
This commit is contained in:
parent
a6f349434f
commit
b517ac7919
1 changed files with 6 additions and 1 deletions
|
@ -160,7 +160,12 @@ class backup_lesson_activity_structure_step extends backup_activity_structure_st
|
|||
// Set the source table for the elements that aren't reliant on the user
|
||||
// at this point (lesson, lesson_pages, lesson_answers)
|
||||
$lesson->set_source_table('lesson', array('id' => backup::VAR_ACTIVITYID));
|
||||
$page->set_source_table('lesson_pages', array('lessonid' => backup::VAR_PARENTID));
|
||||
//we use SQL here as it must be ordered by prevpageid so that restore gets the pages in the right order.
|
||||
$page->set_source_sql("
|
||||
SELECT *
|
||||
FROM {lesson_pages}
|
||||
WHERE lessonid = ? ORDER BY prevpageid",
|
||||
array(backup::VAR_PARENTID));
|
||||
$answer->set_source_table('lesson_answers', array('pageid' => backup::VAR_PARENTID));
|
||||
|
||||
// Check if we are also backing up user information
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue