Moodle

Lesson list not updating with correct topic # after a move.

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.9.3
  • Fix Version/s: STABLE backlog
  • Component/s: Lesson
  • Labels:
    None
  • Environment:
    Moodle 1.9.3+ (Build: 20081029)
  • Affected Branches:
    MOODLE_19_STABLE

Description

I created a course on a1.9.3 production server. I created 120 lessons on a local machine and uploaded them in batches. Each batch of 4 to 8 lessons was in its own course and placed in a single topic. The first two batches of around 16 lessons, I placed them in Topic 2 in my local machine. I uploaded these to the production site. Then the lead teacher said the lessons should start in Topic 1, so I moved the production topic 2 up and it became topic 1.

I went into each of my local courses and moved the batches of lessons to the new topic number system. When I restored the backup of my local course, it put the lessons into the right topic in the production server. Topic 1 ended up with about 50 lessons. Topic 2 had 4 lessons, Topic 3 had 12 lessons and so forth.

From the course homepage, everything looks normal. When I view the /mod/lesson/index.php?id=7 , it shows the all the lessons in the correct order, however the topic for the first and second batch is listed as Topic 2. Then with the third batch and there after, all the topics have the correct number.

I have a feeling that the Topic label is not being updated someplace and the lesson index view is taking the topic number from that place.

Just discovered that I needed to add some lessons to the 1st topic. These lessons need to go inbetween some lessons in the second batch. Every time I tried to move them, they ended up in Topic 2 at the end. I tried moving one to inbetween some lessons I uploaded in the 3 and 4th batch, they went to the right place in the course view. Definately a table issue. Not minor.

Activity

Hide
Chris Collman added a comment -

One problems seems to be that the mdl_course_modules was not updated. When I manually changed the section id number the list corrected itself.

Prior to that I changed the sequence numbers in the mdl_course_sections to insert the lesson page id's . That displayed the course home page items in the correct order.

From the display, I knew these were id 211, 212, 213, 214. I had previously created lessons with id 192, 193,194,195 by importing them. When they did not work, I deleted them (I thought), tried a few tricks and then imported 4 more lessons. I could move two of them via the interface. But the other two kept going back to Topic 2 until I changed the sequence number in Topic 2 (deleted the 2 ids) and added them in the right spot in Topic 1 sequence numbers.

Finally, I do not see the lesson page id's in my last import in mdl_lesson, it stops with the 195 id. As admin, I can click on the 211 lesson and see it. Worried that they are not on this list.

Show
Chris Collman added a comment - One problems seems to be that the mdl_course_modules was not updated. When I manually changed the section id number the list corrected itself. Prior to that I changed the sequence numbers in the mdl_course_sections to insert the lesson page id's . That displayed the course home page items in the correct order. From the display, I knew these were id 211, 212, 213, 214. I had previously created lessons with id 192, 193,194,195 by importing them. When they did not work, I deleted them (I thought), tried a few tricks and then imported 4 more lessons. I could move two of them via the interface. But the other two kept going back to Topic 2 until I changed the sequence number in Topic 2 (deleted the 2 ids) and added them in the right spot in Topic 1 sequence numbers. Finally, I do not see the lesson page id's in my last import in mdl_lesson, it stops with the 195 id. As admin, I can click on the 211 lesson and see it. Worried that they are not on this list.
Hide
Chris Collman added a comment -

I did a restore to a new course from a backup I made before I started my work. All the ids are in order, the lesson list shows the correct section number. I was able to add 4 lessons from a backup and move them to the correct spots.

Now I wonder if that is in the FAQs someplace? There is still an issue with the code but at least the restore process fixes it.

3 hours later, more educated as to the content of SQL tables but just a little behind on my timetable after finding the solution to absolutely everything

Best Chris

Show
Chris Collman added a comment - I did a restore to a new course from a backup I made before I started my work. All the ids are in order, the lesson list shows the correct section number. I was able to add 4 lessons from a backup and move them to the correct spots. Now I wonder if that is in the FAQs someplace? There is still an issue with the code but at least the restore process fixes it. 3 hours later, more educated as to the content of SQL tables but just a little behind on my timetable after finding the solution to absolutely everything Best Chris
Hide
Simon Coggins added a comment -

I've just had a go at trying to reproduce this bug but I haven't been able to get the same behaviour. I'm running version 1.9.5 so it's possible that it has been fixed, or maybe I'm not replicating what happened closely enough.

Here are the steps I took:

1. Create a new course in topics format
2. Add a couple of new lessons to topic 2
3. Create a backup .zip file from the course admin panel
4. Next I created a second moodle instance. It's not running on a different server but I created a whole new set of moodle files and a new database so it should behave the same as a completely different server. I'll call this second instance the 'production version' and the first instance the 'test version'
5. Create a new course on the production version (also in topic format).
6. Copy the backup .zip file from the course data directory of the test version to the new course backupdata directory of the production version.
7. Restore the course from backup. The lessons appear in topic 2
8. Move the lessons from topic 2 to topic 1 in the production version
9. Move the lessons from topic 2 to topic 1 in the test version
10. Create a second backup .zip file from the test version (now with the lessons moved to topic 1)
11. Copy that file into the backupdata directory in the production version
12. Restore the second backup .zip file to the production version, deleting the previous course
13. Click on one of the lessons in the production version
14. Click the "Lessons" link in the breadcrumbs navigation to get to the Lessons page

At this point all the lessons correctly state they are in topic 1 for me. As I understand that is not the case for you (they still say topic 2)? Have I correctly replicated the steps that you took?

Perhaps you could expand on what you did, or ideally reduce the problem down to the simplest set of steps that still causes the problem.

Show
Simon Coggins added a comment - I've just had a go at trying to reproduce this bug but I haven't been able to get the same behaviour. I'm running version 1.9.5 so it's possible that it has been fixed, or maybe I'm not replicating what happened closely enough. Here are the steps I took: 1. Create a new course in topics format 2. Add a couple of new lessons to topic 2 3. Create a backup .zip file from the course admin panel 4. Next I created a second moodle instance. It's not running on a different server but I created a whole new set of moodle files and a new database so it should behave the same as a completely different server. I'll call this second instance the 'production version' and the first instance the 'test version' 5. Create a new course on the production version (also in topic format). 6. Copy the backup .zip file from the course data directory of the test version to the new course backupdata directory of the production version. 7. Restore the course from backup. The lessons appear in topic 2 8. Move the lessons from topic 2 to topic 1 in the production version 9. Move the lessons from topic 2 to topic 1 in the test version 10. Create a second backup .zip file from the test version (now with the lessons moved to topic 1) 11. Copy that file into the backupdata directory in the production version 12. Restore the second backup .zip file to the production version, deleting the previous course 13. Click on one of the lessons in the production version 14. Click the "Lessons" link in the breadcrumbs navigation to get to the Lessons page At this point all the lessons correctly state they are in topic 1 for me. As I understand that is not the case for you (they still say topic 2)? Have I correctly replicated the steps that you took? Perhaps you could expand on what you did, or ideally reduce the problem down to the simplest set of steps that still causes the problem.
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.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: