From fcd8289613ca1eb56aeab6143ecdad5bc1bea1b4 Mon Sep 17 00:00:00 2001
From: Tom Ruether <info@redscout.de>
Date: Mon, 27 Jan 2014 17:19:48 +0100
Subject: [PATCH] [BUGFIX] CommandController is not executed at same time

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/27073
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs
Reviewed-by: Stefan Neufeind
Reviewed-by: Markus Klein
Tested-by: Markus Klein
---
 typo3/sysext/extbase/Classes/Scheduler/TaskExecutor.php | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/typo3/sysext/extbase/Classes/Scheduler/TaskExecutor.php b/typo3/sysext/extbase/Classes/Scheduler/TaskExecutor.php
index 7627e52e26ba..e6651bda6740 100644
--- a/typo3/sysext/extbase/Classes/Scheduler/TaskExecutor.php
+++ b/typo3/sysext/extbase/Classes/Scheduler/TaskExecutor.php
@@ -69,11 +69,9 @@ class TaskExecutor implements \TYPO3\CMS\Core\SingletonInterface {
 	protected $configurationManager;
 
 	/**
-	 * 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');
 	}
 
@@ -84,6 +82,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);
-- 
GitLab