[BUGFIX] Scheduler BE module fails to load due to autoloader issues
authorDmitry Dulepov <dmitry@typo3.org>
Wed, 11 Jan 2012 12:15:00 +0000 (14:15 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 28 Jan 2012 14:36:44 +0000 (15:36 +0100)
When displaying a list of tasks, scheduler unserializes exceptions.
By default, unserialize() does not call autoloader to load classes
and it is possible that the exception class will not be loaded. In
such case scheduler BE module will fail with a PHP fatal error
when the scheduler will try to use a _PHP_Incomplete_Class.

The fix makes sure that autoloader is called during unserialize().
However this still may fail, so the scheduler now checks that the
exception is loaded properly before trying to use it.

Change-Id: I77ef3bf765019ab7ceb5bc45049d14b22db6f701
Resolves: #33116
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/7736
Reviewed-by: Philipp Gampe
Reviewed-by: Andy Grunwald
Reviewed-by: Steffen Ritter
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

index ab41c11..80fdbb0 100644 (file)
@@ -67,6 +67,7 @@ class t3lib_autoloader {
        public static function registerAutoloader() {
+               @ini_set('unserialize_callback_func', 'spl_autoload_call');
                return spl_autoload_register('t3lib_autoloader::autoload', TRUE, TRUE);
index 7d0ef75..6818bdf 100644 (file)
@@ -1134,7 +1134,7 @@ class tx_scheduler_Module extends t3lib_SCbase {
                                                        /** @var $exception Exception */
                                                $exception = unserialize($schedulerRecord['lastexecution_failure']);
                                                        // If the exception could not be unserialized, issue a default error message
-                                               if ($exception === FALSE) {
+                                               if ($exception === FALSE || ($exception instanceof __PHP_Incomplete_Class)) {
                                                        $failureDetail = $GLOBALS['LANG']->getLL('msg.executionFailureDefault');
                                                } else {
                                                        $failureDetail = sprintf($GLOBALS['LANG']->getLL('msg.executionFailureReport'), $exception->getCode(), $exception->getMessage());