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

Not all core settings defaults are applied anymore

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
    • Testing Instructions:
      Hide

      1. Install a fresh copy of Moodle, using patch from this ticket. e.g.
      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, using patch from this ticket. e.g. 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
    • Affected Branches:
      MOODLE_36_STABLE
    • Pull 3.6 Branch:
      MOODLE_36_STABLE_MDL-63795_core_setting_defaults
    • Pull Master Branch:
      master_MDL-63795_core_setting_defaults

      Description

      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.

       

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 21 minutes
                  21m