[BUGFIX] Scheduler tasks of deactivated exts should be considered invalid 46/41246/5
authorGeorg Ringer <georg.ringer@gmail.com>
Tue, 14 Jul 2015 21:05:00 +0000 (23:05 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 14 Jul 2015 21:28:53 +0000 (23:28 +0200)
If a scheduler task is created and the extension which provides the task is
deactivated the task must be shown as invalid in the list- and edit-view.

Change-Id: Iaf63c48c73ddaad64e153046d548eef5bbbcc7ae
Resolves: #68140
Releases: master
Reviewed-on: http://review.typo3.org/41246
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php

index 82c84da..d8212cb 100644 (file)
@@ -563,7 +563,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                                $taskInfo['task_group'] = $taskRecord['task_group'];
 
                                // Check that the task object is valid
-                               if ($this->scheduler->isValidTaskObject($task)) {
+                               if (isset($registeredClasses[get_class($task)]) && $this->scheduler->isValidTaskObject($task)) {
                                        // The task object is valid, process with fetching current data
                                        $taskInfo['class'] = get_class($task);
                                        // Get execution information
@@ -944,6 +944,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                                $temporaryResult[$row['task_group']]['groupDescription'] = $row['taskGroupDescription'];
                                $temporaryResult[$row['task_group']]['tasks'][] = $row;
                        }
+                       $registeredClasses = $this->getRegisteredClasses();
                        foreach ($temporaryResult as $taskGroup) {
                                if (!empty($taskGroup['groupName'])) {
                                        $groupText = '<strong>' . htmlspecialchars($taskGroup['groupName']) . '</strong>';
@@ -995,7 +996,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                                                $lastExecution .= ' (' . $context . ')';
                                        }
 
-                                       if ($this->scheduler->isValidTaskObject($task)) {
+                                       if (isset($registeredClasses[get_class($task)]) && $this->scheduler->isValidTaskObject($task)) {
                                                // The task object is valid
                                                $labels = array();
                                                $name = htmlspecialchars($registeredClasses[$class]['title'] . ' (' . $registeredClasses[$class]['extension'] . ')');