[FOLLOWUP] Make FormatsViewHelper compilable 22/39222/2
authorFrank Nägler <typo3@naegler.net>
Sat, 2 May 2015 21:50:04 +0000 (23:50 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Sat, 2 May 2015 22:02:37 +0000 (00:02 +0200)
This patch is a follow-up to fix broken ExtensionManager.

Resolves: #66760
Releases: master
Change-Id: I2f4023e220acf683faf7188adea0e6e8010dce67
Reviewed-on: http://review.typo3.org/39222
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/documentation/Classes/Slots/ExtensionManager.php

index b583231..0b15a02 100644 (file)
@@ -15,6 +15,8 @@ namespace TYPO3\CMS\Documentation\Slots;
  */
 
 use TYPO3\CMS\Backend\Utility\IconUtility;
+use TYPO3\CMS\Documentation\ViewHelpers\FormatsViewHelper;
+use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext;
 
 /**
  * This slot listens to a signal in Extension Manager to add links to
@@ -54,11 +56,14 @@ class ExtensionManager {
                if (isset(static::$documents[$documentKey])) {
                        $document = static::$documents[$documentKey];
 
-                       /** @var \TYPO3\CMS\Documentation\ViewHelpers\FormatsViewHelper $formatsViewHelper */
-                       $formatsViewHelper = $this->objectManager->get(\TYPO3\CMS\Documentation\ViewHelpers\FormatsViewHelper::class);
-
                        foreach ($document->getTranslations() as $documentTranslation) {
-                               $actions[] = $formatsViewHelper->render($documentTranslation);
+                               $actions[] = FormatsViewHelper::renderStatic(
+                                       array(
+                                               'documentTranslation' => $documentTranslation,
+                                       ),
+                                       function() {},
+                                       new RenderingContext()
+                               );
                        }
                } else {
                        $actions[] = '<span class="btn btn-default disabled">' . IconUtility::getSpriteIcon('empty-empty') . '</span>';