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

Enabling maintenance mode via cli is not recorded in the config log

    • MDL-84504-maintenance-log-MOODLE_404_STABLE
    • MDL-84504-maintenance-log-MOODLE_405_STABLE
    • MDL-84504-maintenance-log
    • Hide
      1. Manual maintenance mode
        1. Reset the config_log to make testing simpler:
          delete from mdl_config_log;
        2. Log in as an admin
        3. Visit /admin/settings.php?section=maintenancemode
        4. Turn on maintenance mode
        5. Turn off maintenance mode
        6. Visit /report/configlog/index.php
        7. Confirm you see two log entries turning it on to 1 and then to 0
      2. CLI soft maintenance mode
        1. Reset the config_log to make testing simpler:
          delete from mdl_config_log;
        2. Enable via cli
          php admin/cli/maintenance.php --enableold
        3. Disable via cli
          php admin/cli/maintenance.php --disable
        4. Visit /report/configlog/index.php
        5. Confirm you see two log entries turning it on to 1 and then off to 0
      3. CLI hard maintenance mode
        1. Reset the config_log to make testing simpler:
          delete from mdl_config_log;
        2. Enable via cli
          php admin/cli/maintenance.php --enable
        3. Run a second time on purpose
          php admin/cli/maintenance.php --enable
        4. Disable via cli
          php admin/cli/maintenance.php --disable
        5. Visit /report/configlog/index.php
        6. Confirm you see exactly two log entries turning it on in cli 'mode' and then off to 0
      4. CLI maintenance later mode
        1. Reset the config_log to make testing simpler:
          delete from mdl_config_log;
        2. Enable via cli in 1 minute
          php admin/cli/maintenance.php --enablelater=1
        3. Quickly run a second time on purpose, this time for 9 seconds
          php admin/cli/maintenance.php --enablelater=0.15
        4. Quick view
          Visit /report/configlog/index.php
        5. Confirm you can see both logs
        6. Wait a few seconds and reload the page until you confirm maintenance mode has started
        7. Disable via cli
          php admin/cli/maintenance.php --disable
        8. Visit /report/configlog/index.php
        9. Confirm you are NOT redirected to the home page
        10. Confirm you see the log which swaps from maintenance later to maintenance on
        11. Confirm that this log entry has no user (ie it is the system changing it, not the random person who happened to be loading the first page after the time ticks over
      Show
      Manual maintenance mode Reset the config_log to make testing simpler: delete from mdl_config_log; Log in as an admin Visit /admin/settings.php?section=maintenancemode Turn on maintenance mode Turn off maintenance mode Visit /report/configlog/index.php Confirm you see two log entries turning it on to 1 and then to 0 CLI soft maintenance mode Reset the config_log to make testing simpler: delete from mdl_config_log; Enable via cli php admin/cli/maintenance.php --enableold Disable via cli php admin/cli/maintenance.php --disable Visit /report/configlog/index.php Confirm you see two log entries turning it on to 1 and then off to 0 CLI hard maintenance mode Reset the config_log to make testing simpler: delete from mdl_config_log; Enable via cli php admin/cli/maintenance.php --enable Run a second time on purpose php admin/cli/maintenance.php --enable Disable via cli php admin/cli/maintenance.php --disable Visit /report/configlog/index.php Confirm you see exactly two log entries turning it on in cli 'mode' and then off to 0 CLI maintenance later mode Reset the config_log to make testing simpler: delete from mdl_config_log; Enable via cli in 1 minute php admin/cli/maintenance.php --enablelater=1 Quickly run a second time on purpose, this time for 9 seconds php admin/cli/maintenance.php --enablelater=0.15 Quick view Visit /report/configlog/index.php Confirm you can see both logs Wait a few seconds and reload the page until you confirm maintenance mode has started Disable via cli php admin/cli/maintenance.php --disable Visit /report/configlog/index.php Confirm you are NOT redirected to the home page Confirm you see the log which swaps from maintenance later to maintenance on Confirm that this log entry has no user (ie it is the system changing it, not the random person who happened to be loading the first page after the time ticks over
    • Hide

      Fails against automated checks.

      Checked MDL-84504 using repository: https://github.com/brendanheywood/moodle

      Should these errors be fixed?

      Built on: Tue Apr 22 01:25:43 UTC 2025

      Show
      Fails against automated checks. Checked MDL-84504 using repository: https://github.com/brendanheywood/moodle MOODLE_404_STABLE [branch: MDL-84504-maintenance-log-MOODLE_404_STABLE | CI Job ] Error: The MDL-84504 -maintenance-log-MOODLE_404_STABLE branch at https://github.com/brendanheywood/moodle is very old (>60 days ago). Please rebase against current MOODLE_404_STABLE. MOODLE_405_STABLE [branch: MDL-84504-maintenance-log-MOODLE_405_STABLE | CI Job ] Error: The MDL-84504 -maintenance-log-MOODLE_405_STABLE branch at https://github.com/brendanheywood/moodle is very old (>60 days ago). Please rebase against current MOODLE_405_STABLE. main [branch: MDL-84504-maintenance-log | CI Job ] Error: The MDL-84504 -maintenance-log branch at https://github.com/brendanheywood/moodle is very old (>60 days ago). Please rebase against current main. Should these errors be fixed? Built on: Tue Apr 22 01:25:43 UTC 2025
    • Hide

      Launching automatic jobs for branch MDL-84504-maintenance-log-MOODLE_404_STABLE

      Launching automatic jobs for branch MDL-84504-maintenance-log-MOODLE_405_STABLE

      Launching automatic jobs for branch MDL-84504-maintenance-log

      Built on: Tue Apr 22 02:25:22 UTC 2025

      Show
      Launching automatic jobs for branch MDL-84504 -maintenance-log-MOODLE_404_STABLE https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/19084/ PHPUnit (sqlsrv) --> unrelated https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65255/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65256/ Behat (Firefox - boost) Launching automatic jobs for branch MDL-84504 -maintenance-log-MOODLE_405_STABLE https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/19085/ PHPUnit (sqlsrv) --> unrelated https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65257/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65258/ Behat (Firefox - boost) Launching automatic jobs for branch MDL-84504 -maintenance-log https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/19086/ PHPUnit (sqlsrv) --> unrelated https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65259/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65260/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65261/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/65262/ App tests (stable app version) Built on: Tue Apr 22 02:25:22 UTC 2025
    • Hhogs Merge Review Candidates

      Turning this on via the UI does log, doing it via the cli does not log.

      You could argue this has been a bug since forever.

            brendanheywood Brendan Heywood
            brendanheywood Brendan Heywood
            Benjamin Walker Benjamin Walker
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

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

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