[BUGFIX] Filelist Treeview: Removed call to deprecated method render() 85/46585/2
authorMichael Oehlhof <typo3@oehlhof.de>
Wed, 10 Feb 2016 22:34:14 +0000 (23:34 +0100)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Thu, 11 Feb 2016 10:05:28 +0000 (11:05 +0100)
Call of FlashMessage->render() when no folders are available
was replaced with appropriate code.

Resolves: #73222
Releases: master, 7.6
Change-Id: Ie5eec53618d506e41c5bbf0a9a1b24e92c2b1549
Reviewed-on: https://review.typo3.org/46582
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
(cherry picked from commit ef3c9d38ab3cc94a25e51ea2d5922ce3607498d1)
Reviewed-on: https://review.typo3.org/46585

typo3/sysext/backend/Classes/Tree/View/FolderTreeView.php

index c43b238..9cadfd1 100644 (file)
@@ -18,6 +18,7 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 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\Folder;
 use TYPO3\CMS\Core\Resource\FolderInterface;
 use TYPO3\CMS\Core\Resource\InaccessibleFolder;
@@ -465,7 +466,12 @@ class FolderTreeView extends AbstractTreeView
                 $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang.xlf:foldertreeview.noFolders.title'),
                 FlashMessage::INFO
             );
-            return $message->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($message);
+            return $defaultFlashMessageQueue->renderFlashMessages();
         }
 
         $expandedFolderHash = '';