[BUGFIX] Linkvalidator: Removed call to deprecated method render() 93/46793/2
authorMichael Oehlhof <typo3@oehlhof.de>
Sat, 20 Feb 2016 00:02:16 +0000 (01:02 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 20 Feb 2016 13:20:02 +0000 (14:20 +0100)
Call of FlashMessage->render() if user not have access to these listings
and when no broken links to be displayed were replaced with appropriate
code.

Resolves: #73576
Releases: master, 7.6
Change-Id: I86ce5c1dd49ea40aeb26be8f9da1060b1f6dc65d
Reviewed-on: https://review.typo3.org/46793
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php

index 449c770..56890b3 100644 (file)
@@ -20,6 +20,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\Service\MarkerBasedTemplateService;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -323,7 +324,11 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
                 $this->getLanguageService()->getLL('no.access.title'),
                 FlashMessage::ERROR
             );
-            $this->content .= $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);
         }
     }
 
@@ -442,7 +447,12 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
             $this->getLanguageService()->getLL('list.no.broken.links.title'),
             FlashMessage::OK
         );
-        $brokenLinksMarker['NO_BROKEN_LINKS'] = $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);
+        $brokenLinksMarker['NO_BROKEN_LINKS'] = $defaultFlashMessageQueue->renderFlashMessages();
         return $brokenLinksMarker;
     }