diff --git a/admin/tool/task/renderer.php b/admin/tool/task/renderer.php index a003eab27a8..ec0bb0cac4a 100644 --- a/admin/tool/task/renderer.php +++ b/admin/tool/task/renderer.php @@ -48,6 +48,7 @@ class tool_task_renderer extends plugin_renderer_base { $showloglink = \core\task\logmanager::has_log_report(); $table = new html_table(); + $table->caption = get_string('scheduledtasks', 'tool_task'); $table->head = [ get_string('name'), get_string('component', 'tool_task'), @@ -180,7 +181,7 @@ class tool_task_renderer extends plugin_renderer_base { $plugininfo->init_display_name(); $componentname = $plugininfo->displayname; - if (!$plugininfo->is_enabled()) { + if ($plugininfo->is_enabled() === false) { $componentname .= ' ' . html_writer::span( get_string('disabled', 'tool_task'), 'badge badge-secondary'); } diff --git a/admin/tool/task/tests/behat/manage_tasks.feature b/admin/tool/task/tests/behat/manage_tasks.feature index 160451d7340..dd27d85f713 100644 --- a/admin/tool/task/tests/behat/manage_tasks.feature +++ b/admin/tool/task/tests/behat/manage_tasks.feature @@ -65,3 +65,9 @@ Feature: Manage scheduled tasks | Name | Component | Minute | Hour | Day | Day of week | Month | | Log table cleanup | Standard log | */5 | 1 | 2 | 4 | 3 | And I should see "Log table cleanup" in the "tr.table-primary" "css_element" + + Scenario: Disabled plugin's tasks are labelled as disabled too + When "CAS users sync job \auth_cas\task\sync_task" row "Next run" column of "Scheduled tasks" table should contain "Plugin disabled" + Then "CAS users sync job \auth_cas\task\sync_task" row "Component" column of "Scheduled tasks" table should contain "Disabled" + And "Background processing for scheduled allocation \workshopallocation_scheduled\task\cron_task" row "Next run" column of "Scheduled tasks" table should not contain "Plugin disabled" + And "Background processing for scheduled allocation \workshopallocation_scheduled\task\cron_task" row "Component" column of "Scheduled tasks" table should not contain "Disabled"