[BUGFIX] CommandController is not executed at same time 54/27654/2
authorTom Ruether <info@redscout.de>
Mon, 27 Jan 2014 16:19:48 +0000 (17:19 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Mon, 17 Feb 2014 10:05:37 +0000 (11:05 +0100)
To execute more than one different CommandController at
the same time, every execute call has to use its own request
and response object. Otherwise the request would be already
dispatched for the further tasks.

Fixes: #55362
Releases: 6.2, 6.1 , 6.0
Change-Id: I62ba9cbd2c47a59c7243a1017716b28526bcf6ea
Reviewed-on: https://review.typo3.org/27654
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/extbase/Classes/Scheduler/TaskExecutor.php

index 782a897..3393bd5 100644 (file)
@@ -87,11 +87,9 @@ class TaskExecutor implements \TYPO3\CMS\Core\SingletonInterface {
        }
 
        /**
-        * Initializes Request, Response and Dispatcher
+        * Initialize Dispatcher
         */
        public function initializeObject() {
-               $this->request = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\Request');
-               $this->response = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\Response');
                $this->dispatcher = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Dispatcher');
        }
 
@@ -102,6 +100,9 @@ class TaskExecutor implements \TYPO3\CMS\Core\SingletonInterface {
         * @return void
         */
        protected function initialize(array $configuration) {
+               // initialize unconsumed Request and Response
+               $this->request = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\Request');
+               $this->response = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\Response');
                // initialize configuration
                $this->configurationManager->setContentObject(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer'));
                $this->configurationManager->setConfiguration($configuration);
@@ -161,4 +162,4 @@ class TaskExecutor implements \TYPO3\CMS\Core\SingletonInterface {
        }
 }
 
-?>
\ No newline at end of file
+?>