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

Not all core settings defaults are applied anymore

XMLWordPrintable

    • MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • MOODLE_37_STABLE, MOODLE_38_STABLE
    • master_MDL-63795_core_setting_defaults
    • Hide

      1. Install a fresh copy of Moodle (36_STABLE, 37_STABLE and master)
      2. Install the tool_mdl63795 plugin, from: https://github.com/mattporritt/moodle-tool_mdl63795
      3. Run the upgrade from the cli, e.g. php admin/cli/upgrade.php
      3.1 Upgrade expected output:

      version	2017110900
      -->tool_mdl63795
      ++ Success ++
      == Setting new default values ==
      New setting: tool_mdl63795_initial
      New setting: tool_mdl63795_secondary
      

      4. Check plugin config: php admin/cli/cfg.php --component=tool_mdl63795
      4.1 Expected output

      version	2017110900
      initial	A nice default
      secondary	A secondary value
      version	2019060501
      

      Show
      1. Install a fresh copy of Moodle (36_STABLE, 37_STABLE and master) 2. Install the tool_mdl63795 plugin, from: https://github.com/mattporritt/moodle-tool_mdl63795 3. Run the upgrade from the cli, e.g. php admin/cli/upgrade.php 3.1 Upgrade expected output: version 2017110900 -->tool_mdl63795 ++ Success ++ == Setting new default values == New setting: tool_mdl63795_initial New setting: tool_mdl63795_secondary 4. Check plugin config: php admin/cli/cfg.php --component=tool_mdl63795 4.1 Expected output version 2017110900 initial A nice default secondary A secondary value version 2019060501

      MDL-62777 appears to have caused some core settings, and those of some 3rd party plugins, to no longer be set.

      As far as core goes - tool_mobile no longer has several settings set.

      This appears to be caused by some of the settings being wrapped in a IF check, that stops the settings nodes even existing prior to that setting being enabled.

       

      Pre MDL-62777

      • tool_mobile settings start with `enablemobilewebservice` unset, with a default of `1` and several settings that never get loaded until that is set.
      • admin_apply_default_settings called
        • settings as they currently exist loaded
        • defaults set
      • admin_apply_default_settings  called again
        • new settings now exist as `!empty($CFG->enablemobilewebservice` evaluates to true
        • defaults for those new settings are set

      Post MDL-62777

      • tool_mobile settings start with `enablemobilewebservice` unset, with a default of `1` and several settings that never get loaded until that is set.
      • admin_apply_default_settings called
        • settings as they currently exist loaded
        • for each of those settings, build a list of defaults
        • defaults set
        • call admin_apply_default_settings - but only if we had new defaults applied

       

      It looks like MDL-62777 covers the case where a default settings value may depend on another setting - but not where a settings even "existing" in the settings tree depends on another setting.

       

            mattp@catalyst-au.net Matt Porritt
            aolley Adam Olley
            Luca Bösch Luca Bösch
            Jun Pataleta Jun Pataleta
            Gladys Basiana Gladys Basiana
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 41 minutes
                4h 41m

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