[BUGFIX] Filelist: Removed call to deprecated method render() 23/45923/2
authorMichael Oehlhof <typo3@oehlhof.de>
Sun, 3 Jan 2016 00:37:44 +0000 (01:37 +0100)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 15 Jan 2016 09:49:14 +0000 (10:49 +0100)
Call of FlashMessage->render() when storage is not browsable is replaced
with appropriate code.

Resolves: #72507
Releases: master, 7.6
Change-Id: I3ecc251e1c5c4626773ee1b9c96c34308ab52442
Reviewed-on: https://review.typo3.org/45553
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Sebastian Fischer <typo3@evoweb.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
(cherry picked from commit b53bde237924e98458575331b6d0412bddceda39)
Reviewed-on: https://review.typo3.org/45923

typo3/sysext/filelist/Classes/FileList.php

index f758367..8cd814e 100644 (file)
@@ -22,6 +22,7 @@ use TYPO3\CMS\Core\Database\DatabaseConnection;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
+use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException;
 use TYPO3\CMS\Core\Resource\File;
 use TYPO3\CMS\Core\Resource\Folder;
@@ -460,7 +461,12 @@ class FileList extends AbstractRecordList
         } else {
             /** @var $flashMessage FlashMessage */
             $flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $this->getLanguageService()->getLL('storageNotBrowsableMessage'), $this->getLanguageService()->getLL('storageNotBrowsableTitle'), FlashMessage::INFO);
-            $out = $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);
+            $out = '';
         }
         return $out;
     }