Can't copy a lesson from one course to another using Restore

Can't copy a lesson from one course to another using Restore

by Clarence Prudhoe -
Number of replies: 2

Hi,

I copied a large lesson from course-1 to course-2 using backup and restore.  I merged just that one lesson activity into course-2 from the backup made in course-1.

The merge appeared to be successful so I edited the lesson in course-2.  The lesson works fine in course-1 but it will not run in course-2.  I get this error message:

Could not find lesson pages

More information about this error

Stack trace:
  • line 421 of /lib/setuplib.php: moodle_exception thrown
  • line 2665 of /mod/lesson/locallib.php: call to print_error()
  • line 1299 of /mod/lesson/locallib.php: call to lesson_page_type_manager->load_page()
  • line 271 of /mod/lesson/view.php: call to lesson->load_page()

When I look in the database, I can see the lesson pages in course-2.  And I can edit the pages from the lesson editor in Moodle.  But the lesson won't run.

I assume that the restore function failed to set an address corectly so now Moodle can't locate the lesson pages.  I could edit the address in the database if I had some idea where to look for it.

Does anyone have an idea how to repair the lesson in course-2?  I have already spent a lot of time editing the lesson and don't want to have to do it again.

Thanks,

Clarence

Average of ratings: -
In reply to Clarence Prudhoe

Re: Can't copy a lesson from one course to another using Restore

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Just wondering why you went for the backup and restore option and not the import option, Clarence? (or were there two different Moodles?) Not sure if it would have made a difference to the lesson working or not but worth a thought.

In reply to Mary Cooch

Re: Can't copy a lesson from one course to another using Restore

by Clarence Prudhoe -

Hi Mary,

It is called ignorance smile.  I was unaware of the Inport option, even though it is right there in Course Admin.

However,  I tried to import the same lesson and I get the same error message.

I reported it as a bug at

MDL-25553

Thanks,
Clarence