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

Inconsistent checks used to determine whether to run task through web UI

XMLWordPrintable

    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • MOODLE_311_STABLE
    • Hide
      1. Login as admin
      2. Go to Site administration > Server > System paths and define the "Path to PHP CLI"
      3. Navigate to Server > Tasks > Scheduled tasks in site administration
      4. Press Run now link for the Refresh RSS feeds task task
      5. Press Run now on the confirmation page
      6. Confirm task is executed
      7. Press Back to scheduled tasks
      8. Copy the URL for the Run now link for the Refresh RSS feeds task task, it will look like the following:

        <WWWROOT>/admin/tool/task/schedule_task.php?task=block_rss_client\task\refreshfeeds
        

      9. Amend the ?task=... URL parameter to a task that cannot be run currently, e.g. auth_mnet\task\cron_task, it will look like the following:

        <WWWROOT>/admin/tool/task/schedule_task.php?task=auth_mnet\task\cron_task
        

      10. Manually navigate to updated URL
      11. Confirm you see an exception stating you cannot run the task
      Show
      Login as admin Go to Site administration > Server > System paths and define the "Path to PHP CLI" Navigate to Server > Tasks > Scheduled tasks in site administration Press Run now link for the Refresh RSS feeds task task Press Run now on the confirmation page Confirm task is executed Press Back to scheduled tasks Copy the URL for the Run now link for the Refresh RSS feeds task task, it will look like the following: <WWWROOT>/admin/tool/task/schedule_task.php?task=block_rss_client\task\refreshfeeds Amend the ?task=... URL parameter to a task that cannot be run currently, e.g. auth_mnet\task\cron_task , it will look like the following: <WWWROOT>/admin/tool/task/schedule_task.php?task=auth_mnet\task\cron_task Manually navigate to updated URL Confirm you see an exception stating you cannot run the task

      The following logic is used to determine whether to render the Run now link in the scheduled task listing page:

      1. PHP CLI path is found;
      2. Run now config is enabled;
      3. Task can run

      https://github.com/moodle/moodle/blob/1a9bee69e60f687bcaf4db0569665f4186c515a4/admin/tool/task/renderer.php#L114-L120

      The logic when running the task after pressing Run now is:

      1. Run now config is enabled

      https://github.com/moodle/moodle/blob/1a9bee69e60f687bcaf4db0569665f4186c515a4/admin/tool/task/schedule_task.php#L50-L52

      This means we can manipulate the URL in order to run a task that is otherwise prevented from being run from the scheduled task listing page

            pholden Paul Holden
            pholden Paul Holden
            Amaia Anabitarte Amaia Anabitarte
            Andrew Lyons Andrew Lyons
            Gladys Basiana Gladys Basiana
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 48 minutes
                2h 48m

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