Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-34529

Course sections are not ordered by section (sort order) when selecting activities on the import screen

    Details

    • Database:
      PostgreSQL
    • Testing Instructions:
      Hide

      1/ Login to Moodle.
      2/ Create 2 new test courses.
      3/ Modify the first course and add in a few activities, and then shuffle the course sections using the drag and drop function.
      4/ Enter the second course, and import the contents from the first course.
      5/ Verify the display order of the course sections on the activity selection screen in the import process is displaying in the exact order as displayed on the first course.

      Show
      1/ Login to Moodle. 2/ Create 2 new test courses. 3/ Modify the first course and add in a few activities, and then shuffle the course sections using the drag and drop function. 4/ Enter the second course, and import the contents from the first course. 5/ Verify the display order of the course sections on the activity selection screen in the import process is displaying in the exact order as displayed on the first course.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE

      Description

      When performing an import/restore, the course sections are displayed in any random order returned by the database, rather than being displayed in their actual sort order based on the course configuration/section order. This does not happen in all cases and is dependent on how the database orders the search and output of the results, so may not be replicable in many cases.

      Adding the sort parameter to the database function call appears to solve this problem.

        Gliffy Diagrams

          Activity

          Show
          jaseeey Jason Ilicic added a comment - Patch provided at: https://github.com/jasonilicic/moodle/commit/0c62ad79fb8d0e277da3c4bad4a027db36bec179
          Hide
          salvetore Michael de Raadt added a comment -

          Thanks for providing a fix for that.

          Show
          salvetore Michael de Raadt added a comment - Thanks for providing a fix for that.
          Hide
          fred Frédéric Massart added a comment -

          Hi Jason, thank you for your patch. I tried to reproduce this bug following your test instructions but it all appear fine. I have tried on both MySQL and PostgreSQL.

          Although, I don't see any harm in applying your patch, so I am now pushing it for peer review.

          INTEGRATORS, this cas easily be cherry-picked in 2.3 and master.

          Show
          fred Frédéric Massart added a comment - Hi Jason, thank you for your patch. I tried to reproduce this bug following your test instructions but it all appear fine. I have tried on both MySQL and PostgreSQL. Although, I don't see any harm in applying your patch, so I am now pushing it for peer review. INTEGRATORS, this cas easily be cherry-picked in 2.3 and master.
          Hide
          jaseeey Jason Ilicic added a comment -

          I believe this is an issue that depends on the database. I could not replicate it on my local machine using a newer version of PostgreSQL, but I could very well replicate this using an older version (we use PostgreSQL 8.4 in deployment). I have a feeling it's to do with the search mechanisms used by the DBMS - these may have been revised in newer versions.

          Show
          jaseeey Jason Ilicic added a comment - I believe this is an issue that depends on the database. I could not replicate it on my local machine using a newer version of PostgreSQL, but I could very well replicate this using an older version (we use PostgreSQL 8.4 in deployment). I have a feeling it's to do with the search mechanisms used by the DBMS - these may have been revised in newer versions.
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Integrated (22, 23 & master), thanks!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Integrated (22, 23 & master), thanks!
          Hide
          phalacee Jason Fowler added a comment -

          works fine Fred

          Show
          phalacee Jason Fowler added a comment - works fine Fred
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          YEAR!*

          CAF*, TOT!*

          • Your effort amazingly resulted. (unbelievable :-P)
          • Closing as fixed.
          • Tons of thanks.
          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - YEAR!* CAF*, TOT!* Your effort amazingly resulted. (unbelievable :-P) Closing as fixed. Tons of thanks.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Sep/12