From 38cb2a8eb723f4453290813e4bb2d3f174106035 Mon Sep 17 00:00:00 2001
From: Ralf Zimmermann <ralf.zimmermann@tritum.de>
Date: Mon, 24 Apr 2017 15:10:10 +0200
Subject: [PATCH] [BUGFIX] EXT:form - fix usage of deprecated functions

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>
---
 .../ViewHelpers/RenderAllFormValuesViewHelper.php        | 4 ++--
 .../sysext/form/Classes/ViewHelpers/RenderViewHelper.php | 9 ++++++---
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/typo3/sysext/form/Classes/ViewHelpers/RenderAllFormValuesViewHelper.php b/typo3/sysext/form/Classes/ViewHelpers/RenderAllFormValuesViewHelper.php
index 86b25bc705e2..a302e04a4069 100644
--- a/typo3/sysext/form/Classes/ViewHelpers/RenderAllFormValuesViewHelper.php
+++ b/typo3/sysext/form/Classes/ViewHelpers/RenderAllFormValuesViewHelper.php
@@ -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;
     }
diff --git a/typo3/sysext/form/Classes/ViewHelpers/RenderViewHelper.php b/typo3/sysext/form/Classes/ViewHelpers/RenderViewHelper.php
index 7882ba6ae60d..05237f3f6681 100644
--- a/typo3/sysext/form/Classes/ViewHelpers/RenderViewHelper.php
+++ b/typo3/sysext/form/Classes/ViewHelpers/RenderViewHelper.php
@@ -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();
     }
-- 
GitLab