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

Course backups don't include filter settings

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Development in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1.3, 3.2.1, 3.3
    • Fix Version/s: None
    • Component/s: Filters
    • Labels:
    • Testing Instructions:
      Hide

      To test (or reproduce) this, you need to have a filter that uses the local configuration feature and has multiple config variables. No standard filter makes use of this API. There are few in the contrib - e.g. Video Easy.

      1. Install and enable a suitable filter.
      2. Go into a course and locally configure the filter in the context of the course (Course administration > Filters) or the context of an activity. make sure to change the value of several options (only the first one is backed up without this issue's patch).
      3. Backup the course, make sure to have checked "Include filters" on the first "Backup settings" screen.
      4. (optional) Explore the backup internals and check that all the filter settings are stored in the course/filters.xml (or relevant activity's one) file.
      5. Restore the backup and check that all settings are restored in correct local contexts.
      Show
      To test (or reproduce) this, you need to have a filter that uses the local configuration feature and has multiple config variables. No standard filter makes use of this API. There are few in the contrib - e.g. Video Easy . Install and enable a suitable filter. Go into a course and locally configure the filter in the context of the course (Course administration > Filters) or the context of an activity. make sure to change the value of several options (only the first one is backed up without this issue's patch). Backup the course, make sure to have checked "Include filters" on the first "Backup settings" screen. (optional) Explore the backup internals and check that all the filter settings are stored in the course/filters.xml (or relevant activity's one) file. Restore the backup and check that all settings are restored in correct local contexts.
    • Affected Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE
    • Pull from Repository:
    • Pull 3.1 Branch:
      MDL-57726-backup-filter-settings-31
    • Pull Master Branch:
      MDL-57726-backup-filter-settings-master

      Description

      When we do a course backup it does not include all filter settings at course level and we end up losing all the settings for filters on course restore.

      This is because of duplicate values (i.e. the filter name) in the first column used in a moodle_database::get_records() call. Attached patches use the id field of the table to uniquely index settings, such that filter_get_all_local_settings() returns all settings rather than the last saved value.

        Attachments

        1. after.png
          after.png
          66 kB
        2. before.png
          before.png
          22 kB
        3. ui.png
          ui.png
          46 kB

          Activity

            People

            • Votes:
              7 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: