[BUGFIX] Scheduler now throws exception on SQL query error 08/36208/3
authorMathias Schreiber <mathias.schreiber@wmdb.de>
Sat, 24 Jan 2015 10:49:54 +0000 (11:49 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 26 Jan 2015 01:12:13 +0000 (02:12 +0100)
If the query for fetchTask fails for whatever reason, scheduler will
now gracefully throw an exception instead of assuming it had gotten
a valid resource pointer

Resolves: #39085
Releases: master, 6.2
Change-Id: If4d5e0866bf6e5e17fcafbf4287e330366d995fa
Reviewed-on: http://review.typo3.org/36208
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Julian Hofmann <info@julian-hofmann.net>
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Reviewed-by: Philipp Gampe <philipp.gampe@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/scheduler/Classes/Scheduler.php

index abf3984..26dd67b 100644 (file)
@@ -270,6 +270,9 @@ class Scheduler implements \TYPO3\CMS\Core\SingletonInterface {
                }
 
                $res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryArray);
+               if ($res === FALSE) {
+                       throw new \UnexpectedValueException('Query could not be executed. Possible defect in tables tx_scheduler_task or tx_scheduler_task_group', 1422044826);
+               }
                // If there are no available tasks, thrown an exception
                if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) == 0) {
                        throw new \OutOfBoundsException('No task', 1247827244);