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

Scheduled tasks should consider the enabled state of a plugin

XMLWordPrintable

    • MOODLE_27_STABLE
    • MOODLE_28_STABLE
    • MDL-46207-master
    • Hide

      Install the dummy text editor attached to this issue.
      Run cron
      Verify you see "I ALWAYS RUN!!!!!!!!!!!!!!!!!!!!!!!!Unable to render embedded object: File (" in the cron output, but did not see "I RAN) not found.!!!!!!!!!!!!!!!!!!!".
      Enable the new text editor plugin (manage text editors page).
      Run cron again (it will need to be at least 60 seconds after last cron run).
      Verify you see "I ALWAYS RUN!!!!!!!!!!!!!!!!!!!!!!!!Unable to render embedded object: File (" in the cron output, and see "I RAN) not found.!!!!!!!!!!!!!!!!!!!" in the cron output.

      Show
      Install the dummy text editor attached to this issue. Run cron Verify you see "I ALWAYS RUN!!!!!!!!!!!!!!!!!!!!!!!! Unable to render embedded object: File (" in the cron output, but did not see "I RAN) not found. !!!!!!!!!!!!!!!!!!!". Enable the new text editor plugin (manage text editors page). Run cron again (it will need to be at least 60 seconds after last cron run). Verify you see "I ALWAYS RUN!!!!!!!!!!!!!!!!!!!!!!!! Unable to render embedded object: File (" in the cron output, and see "I RAN) not found. !!!!!!!!!!!!!!!!!!!" in the cron output.

      In MDL-45932, Damyon wrote:

      Finally - the cron function will need to be modified to not do anything if the plugin is not enabled. Legacy cron does not call cron in disabled plugins - but scheduled tasks does not consider this. enrol_is_enabled() will do the trick.

      This seems like a regression to me, if a plugin is disabled my expectation is that core ensures that no code from it is called in cron.

      I guessed this was because we don't have the right hook for it, but mudrd8mz mentions that we have core\plugininfo\base::is_enabled()

            damyon Damyon Wiese
            poltawski Dan Poltawski
            Ankit Agarwal Ankit Agarwal
            Sam Hemelryk Sam Hemelryk
            Andrew Davis Andrew Davis
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

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