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

mdl_data's defaultsort ID not set properly at importing preset.zip

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.9.1
    • 1.8.5, 1.9
    • None
    • MySQL
    • MOODLE_18_STABLE, MOODLE_19_STABLE
    • MOODLE_19_STABLE

      When a preset.zip is imported, values from its preset.xml's <settings></settings> section will be written into the DB table mdl_data. One of these imported settings is the ID number of the field that should act as default sort key. Let's call this ID "PRESETSORTID". It is specified as
      <defaultsort>PRESETSORTID</defaultsort>.

      The smallest value of the id field of the appropriate mdl_data_fields SQL table is the ID number of the first field, let's call it FIRSTID. If you create a new database activity using a preset and completely delete that activity and re-create it, FIRSTID changes (increases).

      The defaultsort field of the appropriate mdl_data SQL table should be filled with
      DEFAULTSORTID = FIRSTID + PRESETSORTID -1, however it just gets filled with
      DEFAULTSORTID = PRESETSORTID.

      This prevents us setting the default sort field using a preset.zip. This is bad because there is currently no other way than using a preset. We only can set the default sort direction (<defaultsortdir>0=ascending or 1=descending</defaultsortdir>), but the default sort field currently is always the Date entered. This does not make sense in many cases.

        1. Author first name - at the bottom.png
          29 kB
          Robert Allerstorfer
        2. Date entered - on top.png
          28 kB
          Robert Allerstorfer
        3. MDL-14336.patch
          0.8 kB
          Robert Allerstorfer

            skodak Petr Skoda
            roal Robert Allerstorfer (Inactive)
            Mathieu Petit-Clair Mathieu Petit-Clair
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.