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

Deprecate dupe cron_run_single_task() function

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.4.5, 3.5
    • Fix Version/s: None
    • Component/s: Tasks
    • Labels:
    • Testing Instructions:
      Hide

      Manual testing steps:

      1. Put into your local directory the attached test file test_cron_run_single_task.php (This script execute \mod_forum\task\cron_task using the deprecated function cron_run_single_task).
      2. Log in as an admin
      3. Go to Site administration / Server / System paths
      4. Set "Path to PHP CLI" to the path to your PHP executable.
        1. On Linux, you can use the value returned by the command "which php" on your terminal.
        2. On Windows, you can use the value returned by the command "where php" on your terminal.
      5. Go to this URL in your browser: http://MOODLESITE/local/test_cron_run_single_task.php
      6. Expected result: Check you can see this error message:

      cron_run_single_task() is deprecated. Please use \tool_task\run_from_cli::execute() instead.
       
          line 3630 of /lib/deprecatedlib.php: call to debugging()
          line 11 of /local/test_cron_run_single_task.php: call to cron_run_single_task()
       
      Execute scheduled task: Forum mailings and maintenance jobs (mod_forum\task\cron_task) Starting digest processing... 
      

      Show
      Manual testing steps: Put into your local directory the attached test file  test_cron_run_single_task.php  (This script execute \mod_forum\task\cron_task using the deprecated function cron_run_single_task). 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 this URL in your browser: http://MOODLESITE/local/test_cron_run_single_task.php Expected result: Check you can see this error message: cron_run_single_task() is deprecated. Please use \tool_task\run_from_cli::execute() instead.   line 3630 of /lib/deprecatedlib.php: call to debugging() line 11 of /local/test_cron_run_single_task.php: call to cron_run_single_task()   Execute scheduled task: Forum mailings and maintenance jobs (mod_forum\task\cron_task) Starting digest processing...
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE
    • Pull Master Branch:
      MDL-63580-master
    • Story Points:
      3
    • Sprint:
      Moppies Moodle 3.8 Sprint 1, Moppies Moodle 3.8 Sprint 2, Moppies Moodle 3.8 Sprint 3, Moppies Moodle 3.8 Sprint 4

      Description

      Working on MDL-60514 we created a new class that does cron_run_single_task() never used again in the core.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated: