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

Scheduled task mod_forum\task\cron_task fails when executed as "Run now" (Backport of MDL-60514)

    XMLWordPrintable

Details

    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • MOODLE_35_STABLE
    • Hide

      Note: Test on Moodle running on Windows and Linux servers.

      1. Log in as an admin
      2. Go to Site administration / Server / System paths
      3. Set "Path to PHP CLI" to the path to your PHP executable.
        • On Linux, you can use the value returned by the command "which php" on your terminal.
        • On Windows, you can use the value returned by the command "where php" on your terminal.
      4. Go to Site administration / Server / Scheduled tasks.
      5. Confirm that there is a "Run now" button in most (if not all) of the tasks.
      6. Click "Run now" for the "Forum mailings and maintenance jobs" task.
      7. On the confirmation prompt, confirm to run the task.
      8. Confirm that the task executes successfully without any errors (except maybe when the outgoing email settings have not been properly configured and that Moodle can't send email messages. This is fine. The important thing is that the task executes okay.)
      9. Go back to the Scheduled tasks page.
      10. Open another browser tab and go to Site administration / Server / System paths
      11. Remove the value in "Path to PHP CLI".
      12. Back on the Scheduled tasks page, click on "Run now" in any of the tasks listed.
      13. On the confirmation prompt, confirm to run the task.
      14. Confirm that you get an error that the path to the PHP CLI can't be found.
      15. Click on "Continue"
      16. Confirm that you are redirected to the System paths page.
      17. Leave the Path to PHP CLI setting blank.
      18. Go back to the scheduled tasks page.
      19. Confirm that the "Run now" links are not shown in any of the scheduled tasks.
      Show
      Note: Test on Moodle running on Windows and Linux servers. Log in as an admin Go to Site administration / Server / System paths Set " Path to PHP CLI " to the path to your PHP executable. On Linux, you can use the value returned by the command " which php " on your terminal. On Windows, you can use the value returned by the command " where php " on your terminal. Go to Site administration / Server / Scheduled tasks. Confirm that there is a "Run now" button in most (if not all) of the tasks. Click " Run now " for the " Forum mailings and maintenance jobs " task. On the confirmation prompt, confirm to run the task. Confirm that the task executes successfully without any errors (except maybe when the outgoing email settings have not been properly configured and that Moodle can't send email messages. This is fine. The important thing is that the task executes okay.) Go back to the Scheduled tasks page. Open another browser tab and go to Site administration / Server / System paths Remove the value in " Path to PHP CLI ". Back on the Scheduled tasks page, click on " Run now " in any of the tasks listed. On the confirmation prompt, confirm to run the task. Confirm that you get an error that the path to the PHP CLI can't be found. Click on " Continue " Confirm that you are redirected to the System paths page. Leave the Path to PHP CLI setting blank. Go back to the scheduled tasks page. Confirm that the " Run now " links are not shown in any of the scheduled tasks.

    Description

      During the PR of MDL-60514, Andrew Nicols has suggested using another strategy to execute cron tasks from the web.

       

       

      Attachments

        Issue Links

          Activity

            People

              markn Mark Nelson
              tonibarbera Toni Barberà
              Mark Nelson Mark Nelson
              David Monllaó David Monllaó
              Janelle Barcega Janelle Barcega
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/Mar/19

                Time Tracking

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