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

Sort courses by name button not working

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.9.3, 1.9.4, 1.9.5, 1.9.6, 1.9.7, 1.9.8, 1.9.9
    • Fix Version/s: 1.9.10
    • Component/s: Course
    • Labels:
      None
    • Environment:
      Linux 2.6 kernel, PHP5, MySQL5
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      For quite some time we have had trouble with courses not sorting properly in all of our categories however we have had no errors that we could detect and were not able to determine what the cause was. While running our enrollment sync against an external database, we have discovered an error (there are several hundred exactly like the sample one below – see attached file for all errors). The course id's match the courses that are out of order within the course categories.

      This has been happening since we have been on 1.9.x (we are currently running 1.9.9).

      This does appear related to MDL-21730.

      Is there a way for us to refresh or correct the sort order fields in the problematic courses (or even in all of them) to resolve this issue?

      -------------- sample error ----------------

      PHP Notice: Duplicate entry '12-4294967295' for key 2<br /><br />UPDATE mdl_course SET sortorder = '4294968296' WHERE id = '2557'<ul style="text-align: left"><li>line 1328 of lib/dmllib.php: call to debugging()</li><li>line 1254 of lib/dmllib.php: call to set_field_select()</li><li>line 1385 of lib/datalib.php: call to set_field()</li><li>line 1411 of lib/datalib.php: call to fix_course_sortorder()</li><li>line 195 of enrol/database/enrol.php: call to fix_course_sortorder()</li><li>line 34 of enrol/database/enrol_database_sync.php: call to enrolment_plugin_database->sync_enrolments()</li></ul> in /path/to/moodle/lib/weblib.php on line 7005
      PHP Notice: Duplicate entry '12-4294967295' for key 2<br /><br />UPDATE mdl_course
      SET sortorder=sortorder+8589937600
      WHERE category=12<ul style="text-align: left"><li>line 103 of lib/dmllib.php: call to debugging()</li><li>line 1376 of lib/datalib.php: call to execute_sql()</li><li>line 1396 of lib/datalib.php: call to fix_course_sortorder()</li><li>line 1411 of lib/datalib.php: call to fix_course_sortorder()</li><li>line 195 of enrol/database/enrol.php: call to fix_course_sortorder()</li><li>line 34 of enrol/database/enrol_database_sync.php: call to enrolment_plugin_database->sync_enrolments()</li></ul> in /path/to/moodle/lib/weblib.php on line 7005

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                andyjdavis Andrew Davis
                Reporter:
                mcksean Sean McKay
                Tester:
                Nobody
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  25/Oct/10