Moodle

Dependencies do not restore correctly in backup

Details

  • Type: Bug Bug
  • Status: Waiting for peer review Waiting for peer review
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9.3, 2.2.1
  • Fix Version/s: None
  • Component/s: Backup, Lesson
  • Labels:
    None
  • Environment:
    Also replicated on Moodle 2.2.1 from self to self
  • Testing Instructions:
    Hide

    Setup for testing

    In a course, turn editing on and:

    • Create a new lesson
    • Create a second new lesson
      • Under the 'Dependent on' section choose the first lesson

    Functionality testing

    Lesson duplication

    • Duplicate the second lesson using the 'x2' button and click through
    • Edit the new lesson
    • Confirm that the 'Dependent on' reports that the lesson is dependent on the first lesson

    Lesson backup/restore within the same course

    • Select the lesson
    • Back up just the lesson
    • Restore the lesson
    • Confirm that the 'Dependent on' reports that the lesson is dependent on the first lesson

    Lesson backup/restore from coursea to courseb

    • Select the lesson
    • Back up just the lesson
    • Restore the lesson to a different course
    • Confirm that the 'Dependent on' lesson link is not set

    Full course backup/restore

    • Back up the entire course
    • Restore the course
    • Confirm that the 'Dependent on' section is correct for each of the lessons
    Show

    Setup for testing

    In a course, turn editing on and:
    • Create a new lesson
    • Create a second new lesson
      • Under the 'Dependent on' section choose the first lesson

    Functionality testing

    Lesson duplication

    • Duplicate the second lesson using the 'x2' button and click through
    • Edit the new lesson
    • Confirm that the 'Dependent on' reports that the lesson is dependent on the first lesson

    Lesson backup/restore within the same course

    • Select the lesson
    • Back up just the lesson
    • Restore the lesson
    • Confirm that the 'Dependent on' reports that the lesson is dependent on the first lesson

    Lesson backup/restore from coursea to courseb

    • Select the lesson
    • Back up just the lesson
    • Restore the lesson to a different course
    • Confirm that the 'Dependent on' lesson link is not set

    Full course backup/restore

    • Back up the entire course
    • Restore the course
    • Confirm that the 'Dependent on' section is correct for each of the lessons
  • Database:
    Any
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_19_STABLE, MOODLE_22_STABLE
  • Pull Master Branch:
    MDL-19421-master-1

Description

When restoring a lesson backup, the dependency information is not correctly re-mapped on the new data. As a result, it still points towards the original ID.

Activity

Hide
Chris Collman added a comment -

Interestingly, the link to activity field in Lesson setting holds but just the dependency field does not. What is so tricky

Show
Chris Collman added a comment - Interestingly, the link to activity field in Lesson setting holds but just the dependency field does not. What is so tricky
Hide
Martin Dougiamas added a comment -

Reassigning this to moodle.com for the time being, since Mark Nielsen is not maintaining Lesson any more. Please comment/vote/patch any crucial bugs that affect you for 2.0 to help us prioritise fixes for the upcoming release.

Show
Martin Dougiamas added a comment - Reassigning this to moodle.com for the time being, since Mark Nielsen is not maintaining Lesson any more. Please comment/vote/patch any crucial bugs that affect you for 2.0 to help us prioritise fixes for the upcoming release.
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Andrew Nicols added a comment -

This is still an issue in 2.2

Show
Andrew Nicols added a comment - This is still an issue in 2.2
Hide
Andrew Nicols added a comment -

Cherry-picks cleanly to:

  • MOODLE_21_STABLE
  • MOODLE_22_STABLE
Show
Andrew Nicols added a comment - Cherry-picks cleanly to:
  • MOODLE_21_STABLE
  • MOODLE_22_STABLE
Hide
Andrew Nicols added a comment -

This patch will correct any mappings as expected in a whole course backup/restore
When duplicating a lesson,the dependency information will be set with the same settings as the lesson being duplicated
When restoring a single lesson activity, if the dependency matches another lesson in the same course as the lesson being created, then the dependency information is kept; otherwise it is emptied.

Show
Andrew Nicols added a comment - This patch will correct any mappings as expected in a whole course backup/restore When duplicating a lesson,the dependency information will be set with the same settings as the lesson being duplicated When restoring a single lesson activity, if the dependency matches another lesson in the same course as the lesson being created, then the dependency information is kept; otherwise it is emptied.
Hide
Andrew Nicols added a comment -

I don't know whether this will ensure correct mappings when restoring Moodle 1.X backups - I'm not familiar with this side of things

Show
Andrew Nicols added a comment - I don't know whether this will ensure correct mappings when restoring Moodle 1.X backups - I'm not familiar with this side of things
Hide
Andrew Nicols added a comment -

Hi Michael,

Any chance we can find a peer reviewer for this bug?

Cheers,

Andrew

Show
Andrew Nicols added a comment - Hi Michael, Any chance we can find a peer reviewer for this bug? Cheers, Andrew

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: