Moodle

Admin cannot restore existing course adding data to it.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.9, 2.0
  • Fix Version/s: 1.9.1
  • Component/s: Backup
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE, MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

I've just noticed this strange behavior, new to 1.9 and 2.0, whereas functionality worked OK in previous Moodle versions.
------------------
PROBLEM
------------------
Checked with 2.0, but same problem exists in 1.9 too.
Logged in as Admin, make a partial backup of any course (other than site front page), e.g. Course 101. Save backup file locally.
Go to Course 102 and go to Restore. Upload previously saved backup file to Files -> backupdata. Click on Restore.
Message: Later in this process you will have a choice of adding this backup to an existing course or creating a completely new course.
Click Continue.

  1. Creating temporary structures
  2. Deleting old data
  3. Copying zip file
    etc.
    Click Continue.
    Restore to -> Select Existing course, adding data to it
    On the next page, as per moodle 1.8, you should be offered the option to **Choose a course** from the list of existing courses on your moodle site... but you are not presented with this option. You only see the Restore this course now button. Click on it, the restore process seems to work:
  4. Using existing course
  • From: Questionnaire module Demo (QUEST_DEMO)
  • To: moodle20 (moodle20)
  • Adding data to existing
  1. Creating groups.
    etc.

but the restored data can be found nowhere on the site!!!
------------------
DIAGNOSTIC
------------------
The problem arises from file backup/restore_check.html lines 247 & sqq. where we strangely have a commented out line, and conditions which are never met for the display of the "choosecourse" message...

------------------
SOLUTION
------------------
I do not understand enough of the workings of the restore functions to suggest a solution but I do hope one will be found, and I am really surprised that this bug has gone un-noticed (in 1.9) so far..

Joseph

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Wow! Incredible! I'm working on this now! Thanks for complete report, Joseph!

Show
Eloy Lafuente (stronk7) added a comment - Wow! Incredible! I'm working on this now! Thanks for complete report, Joseph!
Hide
Eloy Lafuente (stronk7) added a comment -

Found it!

Problem was introduced by my when fixing frontpage restore on April 14th:

http://cvs.moodle.org/moodle/backup/restore_check.html?r1=1.48.2.2&r2=1.48.2.3

I had one typo in line 218:

if (!user_can_create_courses() || $id = SITEID) {

that should be:

if (!user_can_create_courses() || $id == SITEID) {

My tests about restoring frontpage were ok so I didn't detected such typo. Sorry!

Fixed under 19_STABLE and HEAD. Thanks and ciao

Show
Eloy Lafuente (stronk7) added a comment - Found it! Problem was introduced by my when fixing frontpage restore on April 14th: http://cvs.moodle.org/moodle/backup/restore_check.html?r1=1.48.2.2&r2=1.48.2.3 I had one typo in line 218: if (!user_can_create_courses() || $id = SITEID) { that should be: if (!user_can_create_courses() || $id == SITEID) { My tests about restoring frontpage were ok so I didn't detected such typo. Sorry! Fixed under 19_STABLE and HEAD. Thanks and ciao
Hide
Helen Foster added a comment -

Tested with the latest 1.9 - everything working fine

Joseph, thanks for reporting and Eloy, thanks for fixing

Show
Helen Foster added a comment - Tested with the latest 1.9 - everything working fine Joseph, thanks for reporting and Eloy, thanks for fixing

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: