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

CLI upgrade shouldn't output to stderr when no upgrade needed

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.5
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
    • Testing Instructions:
      Hide
      • On a Moodle installation when no upgrade is required, run: php admin/cli/upgrade.php
        • You should see the message "No upgrade needed for the installed version (version number). Thanks for coming anyway!"
      • Run php admin/cli/upgrade.php 1>/dev/null (so that you only see output to stderr)
        • You should see no message
      • Run php admin/cli/upgrade.php 2>/dev/null (so that you only see output to stdout)
        • You should see the message "No upgrade needed for the installed version (version number). Thanks for coming anyway!"
      Show
      On a Moodle installation when no upgrade is required, run: php admin/cli/upgrade.php You should see the message " No upgrade needed for the installed version (version number). Thanks for coming anyway! " Run php admin/cli/upgrade.php 1>/dev/null (so that you only see output to stderr) You should see no message Run php admin/cli/upgrade.php 2>/dev/null (so that you only see output to stdout) You should see the message " No upgrade needed for the installed version (version number). Thanks for coming anyway! "
    • Affected Branches:
      MOODLE_35_STABLE

      Description

      Currently, running admin/cli/upgrade.php when no upgrade is required will exit with status 0 (since this is considered a success), but then it outputs a message to stderr.  This makes it difficult to differentiate between this case and genuine error conditions (e.g. if Moodle cannot connect to the database, it will also exit with status 0 and output to stderr).

      In this case, it should output to stdout, as it does when an upgrade is successfully performed.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: