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

Web running of scheduled tasks is not possible in local plugins

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.3, 3.3 regressions, 3.4
    • 3.3.1
    • Tasks
    • MOODLE_33_STABLE, MOODLE_34_STABLE
    • MOODLE_33_STABLE
    • MDL-59096-master
    • Hide
      1. Unpack the attachment local_silly.zip inside the Moodle local folder (so that it becomes /local/silly).
      2. Go to the admin page on your Moodle and continue through the installation process for the new local_silly plugin.
      3. Go to scheduled tasks.
      4. Find the local_silly task and click 'Run now'

      EXPECTED: The task should run (it does nothing, displaying several lines of output over 6 seconds).

      5. Go back to the scheduled tasks screen and leave this open in a browser tab.

      6. Go to the 'Manage activities' screen and click the eye icon to disable the SCORM module.

      7. Back in the other browser tab with scheduled tasks, find the mod_scorm task

      8. Run the task

      EXPECTED (unchanged): You should see message 'Component is not enabled (mod_scorm)'.

       

      Show
      Unpack the attachment local_silly.zip inside the Moodle local folder (so that it becomes /local/silly). Go to the admin page on your Moodle and continue through the installation process for the new local_silly plugin. Go to scheduled tasks. Find the local_silly task and click 'Run now' EXPECTED: The task should run (it does nothing, displaying several lines of output over 6 seconds). 5. Go back to the scheduled tasks screen and leave this open in a browser tab. 6. Go to the 'Manage activities' screen and click the eye icon to disable the SCORM module. 7. Back in the other browser tab with scheduled tasks, find the mod_scorm task 8. Run the task EXPECTED (unchanged): You should see message 'Component is not enabled (mod_scorm)'.  

    Description

      When trying to run the scheduled task of a local plugin through the web runner. The running is prevented because of this code:

          $component = $task->get_component();
          if ($plugininfo = core_plugin_manager::instance()->get_plugin_info($component)) {
              if (!$plugininfo->is_enabled() && !$task->get_run_if_component_disabled()) {
                  echo "Component is not enabled ($component).\n";
                  return false;
              }
          }
      

      But local plugins can't be enabled, so its not possible to ever run

      Attachments

        Issue Links

          Activity

            People

              quen Sam Marshall
              poltawski Dan Poltawski
              Dan Poltawski Dan Poltawski
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Marcus Green Marcus Green
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                10/Jul/17