[BUGFIX] ManageReferenceIndex: Removed call to deprecated method render() 72/46672/2
authorMichael Oehlhof <typo3@oehlhof.de>
Sat, 13 Feb 2016 00:07:12 +0000 (01:07 +0100)
committerFrank Naegler <frank.naegler@typo3.org>
Mon, 15 Feb 2016 16:03:23 +0000 (17:03 +0100)
Call of FlashMessage->render() was replaced with appropriate code.

Resolves: #73420
Releases: master, 7.6
Change-Id: Id6ec612974a1813bf8becd843d25a48b663766aa
Reviewed-on: https://review.typo3.org/46672
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/core/Classes/Database/ReferenceIndex.php

index bb0b34f..4b5bbcd 100644 (file)
@@ -19,6 +19,7 @@ use TYPO3\CMS\Core\Cache\CacheManager;
 use TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools;
 use TYPO3\CMS\Core\DataHandling\DataHandler;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
+use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\Registry;
 use TYPO3\CMS\Core\Resource\File;
 use TYPO3\CMS\Core\Resource\Folder;
@@ -1243,7 +1244,12 @@ class ReferenceIndex
             $recordsCheckedString,
             $errorCount ? FlashMessage::ERROR : FlashMessage::OK
         );
-        $bodyContent = $flashMessage->render();
+        /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+        $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
+        /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+        $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+        $defaultFlashMessageQueue->enqueue($flashMessage);
+        $bodyContent = $defaultFlashMessageQueue->renderFlashMessages();
         if ($cli_echo) {
             echo $recordsCheckedString . ($errorCount ? 'Updates: ' . $errorCount : 'Index Integrity was perfect!') . LF;
         }