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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.5, 1.9
    • Fix Version/s: 1.9.1
    • Labels:
      None
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            roal Robert Allerstorfer
            Tester:
            Mathieu Petit-Clair
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              15/May/08