[BUGFIX] EXT:form - fix usage of deprecated functions 68/52568/2
authorRalf Zimmermann <ralf.zimmermann@tritum.de>
Mon, 24 Apr 2017 13:10:10 +0000 (15:10 +0200)
committerSascha Egerer <sascha@sascha-egerer.de>
Wed, 3 May 2017 18:12:11 +0000 (20:12 +0200)
Resolves: #80987
Releases: master
Change-Id: Ib6d07021bc6784f74da135487c416af2f21cbd6b
Reviewed-on: https://review.typo3.org/52568
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Sascha Egerer <sascha@sascha-egerer.de>
Tested-by: Sascha Egerer <sascha@sascha-egerer.de>
typo3/sysext/form/Classes/ViewHelpers/RenderAllFormValuesViewHelper.php
typo3/sysext/form/Classes/ViewHelpers/RenderViewHelper.php

index 86b25bc..a302e04 100644 (file)
@@ -100,9 +100,9 @@ class RenderAllFormValuesViewHelper extends AbstractViewHelper
                 'processedValue' => self::processElementValue($element, $value, $renderChildrenClosure, $renderingContext),
                 'isMultiValue' => is_array($value) || $value instanceof \Iterator
             ];
-            $renderingContext->getTemplateVariableContainer()->add($as, $formValue);
+            $renderingContext->getVariableProvider()->add($as, $formValue);
             $output .= $renderChildrenClosure();
-            $renderingContext->getTemplateVariableContainer()->remove($as);
+            $renderingContext->getVariableProvider()->remove($as);
         }
         return $output;
     }
index 7882ba6..05237f3 100644 (file)
@@ -18,7 +18,9 @@ namespace TYPO3\CMS\Form\ViewHelpers;
  */
 
 use TYPO3\CMS\Core\Utility\ArrayUtility;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Mvc\Web\Response;
+use TYPO3\CMS\Extbase\Object\ObjectManager;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3\CMS\Form\Domain\Factory\ArrayFormFactory;
 use TYPO3\CMS\Form\Mvc\Persistence\FormPersistenceManagerInterface;
@@ -78,8 +80,9 @@ class RenderViewHelper extends AbstractViewHelper
         $prototypeName = $arguments['prototypeName'];
         $overrideConfiguration = $arguments['overrideConfiguration'];
 
+        $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
         if (!empty($persistenceIdentifier)) {
-            $formPersistenceManager = $renderingContext->getObjectManager()->get(FormPersistenceManagerInterface::class);
+            $formPersistenceManager = $objectManager->get(FormPersistenceManagerInterface::class);
             $formConfiguration = $formPersistenceManager->load($persistenceIdentifier);
             ArrayUtility::mergeRecursiveWithOverrule(
                 $formConfiguration,
@@ -93,9 +96,9 @@ class RenderViewHelper extends AbstractViewHelper
             $prototypeName = isset($overrideConfiguration['prototypeName']) ? $overrideConfiguration['prototypeName'] : 'standard';
         }
 
-        $factory = $renderingContext->getObjectManager()->get($factoryClass);
+        $factory = $objectManager->get($factoryClass);
         $formDefinition = $factory->build($overrideConfiguration, $prototypeName);
-        $response = $renderingContext->getObjectManager()->get(Response::class, $renderingContext->getControllerContext()->getResponse());
+        $response = $objectManager->get(Response::class, $renderingContext->getControllerContext()->getResponse());
         $form = $formDefinition->bind($renderingContext->getControllerContext()->getRequest(), $response);
         return $form->render();
     }