From 463bf495d4371ad9aa9ca64f6197aafb60a1a5ba Mon Sep 17 00:00:00 2001 From: Ingo Pfennigstorf Date: Fri, 1 Sep 2017 09:29:08 +0200 Subject: [PATCH] Add TYPO3 8 compatible FlashMessage Rendering in update script This fixes the issue, that executing the updater script in the TYPO3 8 backend results in a fatal error, because the FlashMessage handling has been changed. --- class.ext_update.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/class.ext_update.php b/class.ext_update.php index 1d1dd32..daaac62 100644 --- a/class.ext_update.php +++ b/class.ext_update.php @@ -132,7 +132,7 @@ protected function processClearCache() if ($this->clearCache) { // Init TCE - $TCE = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler'); + $TCE = GeneralUtility::makeInstance(TYPO3\CMS\Core\DataHandling\DataHandler::class); $TCE->admin = 1; $TCE->clear_cacheCmd('all'); @@ -192,19 +192,19 @@ protected function messageTitleFromRow(array $row) */ protected function generateOutput() { - $output = ''; - + $flashMessageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class); + $messageQueue = $flashMessageService->getMessageQueueByIdentifier(); foreach ($this->messageList as $message) { $flashMessage = GeneralUtility::makeInstance( - 'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', + FlashMessage::class, $message[2], $message[1], $message[0] ); - $output .= $flashMessage->render(); + $messageQueue->addMessage($flashMessage); } - return $output; + return $messageQueue->renderFlashMessages(); }