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

Scheduled tasks should consider the enabled state of a plugin

    XMLWordPrintable

    Details

    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-46207-master

      Description

      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 David Mudrák (@mudrd8mz) mentions that we have core\plugininfo\base::is_enabled()

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Nov/14