[BUGFIX] Scheduler: Removed call to deprecated method render() 09/46909/2
authorMichael Oehlhof <typo3@oehlhof.de>
Thu, 25 Feb 2016 22:01:45 +0000 (23:01 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 26 Feb 2016 13:08:51 +0000 (14:08 +0100)
Call of FlashMessage->render() when configuring a task with the class
"File Abstraction Layer: Extract metadata in storage" for the
"Registered extractors" was replaced with appropriate code.

Resolves: #73685
Releases: master, 7.6
Change-Id: I1265ad845c2e951c9a5a242f74fa336a26645a88
Reviewed-on: https://review.typo3.org/46909
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/scheduler/Classes/Task/FileStorageExtractionAdditionalFieldProvider.php

index 9b629cf..42cd8a3 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Scheduler\Task;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Resource\Index\ExtractorInterface;
 use TYPO3\CMS\Core\Resource\Index\ExtractorRegistry;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
@@ -115,14 +114,9 @@ class FileStorageExtractionAdditionalFieldProvider implements AdditionalFieldPro
 
         if (empty($extractors)) {
             $labelKey = 'LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:label.fileStorageExtraction.registeredExtractors.without_extractors';
-            /** @var FlashMessage $flashMessage */
-            $flashMessage = GeneralUtility::makeInstance(
-                FlashMessage::class,
-                $this->getLanguageService()->sL($labelKey),
-                '',
-                FlashMessage::WARNING
-            );
-            $content = $flashMessage->render();
+            $content = '<span class="label label-warning">'
+                . htmlspecialchars($this->getLanguageService()->sL($labelKey))
+                . '</span>';
         } else {
             // Assemble the extractor bullet list first.
             $labelKey = 'LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:label.fileStorageExtraction.registeredExtractors.extractor';
@@ -137,14 +131,9 @@ class FileStorageExtractionAdditionalFieldProvider implements AdditionalFieldPro
 
             // Finalize content assembling.
             $labelKey = 'LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:label.fileStorageExtraction.registeredExtractors.with_extractors';
-            /** @var FlashMessage $flashMessage */
-            $flashMessage = GeneralUtility::makeInstance(
-                FlashMessage::class,
-                '<ul>' . implode(LF, $bullets) . '</ul>',
-                $this->getLanguageService()->sL($labelKey),
-                FlashMessage::INFO
-            );
-            $content = $flashMessage->render();
+            $title = $this->getLanguageService()->sL($labelKey);
+            $content = '<p>' . htmlspecialchars($title) . '</p>';
+            $content .= '<ul>' . implode(LF, $bullets) . '</ul>';
         }
 
         $fieldConfiguration = array(