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

Improve admin_apply_default_settings()

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 4.3
    • 4.2.1
    • Installation
    • MOODLE_402_STABLE
    • MOODLE_403_STABLE
    • Hide

      All changes should be covered by PHPunit.

      Manual testing steps for upgrades:

      1. add some new setting and bump relevant version
      2. upgrade from CLI  

        php admin/cli/upgrade.php --verbose-settings 

      1. confirm the output lists the new settings

      Other tests:

      1. install Moodle from CLI and confirm there are no debugging messages
      2. install Moodle from web and confirm there are no debugging messages
      3. init PHPUnit and confirm there are no debugging messages
      4. init Behat and confirm there are no debugging messages
      Show
      All changes should be covered by PHPunit. Manual testing steps for upgrades: add some new setting and bump relevant version upgrade from CLI   php admin/cli/upgrade.php --verbose-settings confirm the output lists the new settings Other tests: install Moodle from CLI and confirm there are no debugging messages install Moodle from web and confirm there are no debugging messages init PHPUnit and confirm there are no debugging messages init Behat and confirm there are no debugging messages

    Description

      The code in admin_apply_default_settings() could be improved.

      List of problems:

      • PHPDocs do not match parameters
      • The last two parameters have confusing docs and are actually unnecessary
      • Repeated executions do not need to use $unconditional parameter
      • There is no prevention of infinite repeating it seems
      • Writing errors are ignored
      • setting names are not unique - it has to use $setting->plugin, not just $setting->name
      • setting names printed during upgrade are not using standard format like admin UI "pluginname/settingname"
      • function parameters and return do not have PHP type specified

      Attachments

        Issue Links

          Activity

            People

              skodak Petr Skoda (Inactive)
              skodak Petr Skoda (Inactive)
              Farhan Karmali Farhan Karmali
              Andrew Lyons Andrew Lyons
              Kim Jared Lucas Kim Jared Lucas
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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

                  Clockify

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