Schedule task manager misinterprets core\plugininfo\base::is_enabled()

Description

In the https://moodle.atlassian.net/browse/MDL-46207#icft=MDL-46207, we introduced a check for the plugin enabled/disabled status. Since 2.8, we do not execute tasks for disabled plugins unless the task explicitly overrides this behaviour via `get_run_if_component_disabled()` method.

However, the world is not black and white. Many of our plugin types (most actually) do not have support for enabling/disabling individual plugins. For these, the plugininfo's `is_enabled()` returns null (as documented in that method's phpDoc).

The trouble is that we do not execute tasks for these plugins too - we consider them all as disabled. Which is IMHO wrong. We should explicitly check for really disabled plugins.

Testing Instructions

Make sure that plugin types that do not support explicit enabled/disabled status (such as local plugins) have their scheduled tasks executed.

Automated test results

None

Pre-check results

None

Workaround

None

Activity

Marina Glancy
26 November 2014 at 19:37
Dan Poltawski
12 November 2014 at 20:28

Thanks for your contributions! This change is now available from the main moodl.git repository and will shortly be available on download.moodle.org.

In programming, the hard part isn't solving problems, but deciding what problems to solve.
– Paul Graham

Simey Lameze
12 November 2014 at 11:38

Thanks David. Passing :check_mark:

Dan Poltawski
12 November 2014 at 01:18

Integrated to master and 28 - thanks David

David Mudrak
11 November 2014 at 21:24

Thanks for the review Petr. I think this patch is a good solution for the moment. I'm not quite sure on how to improve the plugininfo API as I tend to agree with Tim. That's for another issue though.

Fixed

Details

Priority

Affects versions

Assignee

Reporter

Peer reviewer

Integrator

Fix versions

Tester

Participants

Dan Poltawski
David Mudrak
Marina Glancy
noreply
Petr Skoda
Simey Lameze

Pull Main Branch

Clockify

Created 10 November 2014 at 17:45
Updated 4 August 2022 at 09:57
Resolved 12 November 2014 at 20:28