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

Web running of scheduled tasks is not possible in local plugins

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3, 3.3 regressions, 3.4
    • Fix Version/s: 3.3.1
    • Component/s: Tasks
    • Labels:
    • Testing Instructions:
      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)'.  
    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull Master Branch:
      MDL-59096-master

      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

              • Assignee:
                quen Sam Marshall
                Reporter:
                poltawski Dan Poltawski
                Peer reviewer:
                Dan Poltawski
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                Marcus Green
                Participants:
                Component watchers:
                Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Jul/17