Actions
Bug #97834
closedException when AdvancedPassword is used
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2022-06-30
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Remote Sprint
Description
The new type hint ?object $object
in EXT:fluid AbstractFormViewHelper:renderHiddenIdentityField
leads to errors in combination with the EXT:form AdvancedPassword
form element after the form was submitted.
main: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormViewHelper.php#L75
v11.5: https://github.com/TYPO3/typo3/blob/11.5/typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormViewHelper.php#L80
(1/1) TypeError TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewHelper::renderHiddenIdentityField(): Argument #1 ($object) must be of type ?object, string given, called in /var/www/html/packages/TYPO3.CMS/typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormFieldViewHelper.php on line 258 in /var/www/html/packages/TYPO3.CMS/typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormViewHelper.php line 75 * @param string|null $name Name * @return string A hidden field containing the Identity (uid) of the given object * @see \TYPO3\CMS\Extbase\Mvc\Controller\Argument::setValue() */ protected function renderHiddenIdentityField(?object $object, ?string $name): string { if ($object instanceof LazyLoadingProxy) { $object = $object->_loadRealInstance(); } at TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewHelper->renderHiddenIdentityField('e', 'xxx-1[advancedpassword-1]') in /var/www/html/packages/TYPO3.CMS/typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormFieldViewHelper.php line 258 $propertySegmentsCount = count($propertySegments); for ($i = 1; $i < $propertySegmentsCount; $i++) { $object = ObjectAccess::getPropertyPath($formObject, implode('.', array_slice($propertySegments, 0, $i))); $objectName .= '[' . $propertySegments[$i - 1] . ']'; $hiddenIdentityField = $this->renderHiddenIdentityField($object, $objectName); // Add the hidden identity field to the ViewHelperVariableContainer $additionalIdentityProperties = $viewHelperVariableContainer->get( FormViewHelper::class, 'additionalIdentityProperties' at TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper->addAdditionalIdentityPropertiesIfNeeded() in /var/www/html/packages/TYPO3.CMS/typo3/sysext/fluid/Classes/ViewHelpers/Form/PasswordViewHelper.php line 78 $this->tag->addAttribute('type', 'password'); $this->tag->addAttribute('name', $name); $this->tag->addAttribute('value', $this->getValueAttribute()); $this->addAdditionalIdentityPropertiesIfNeeded(); $this->setErrorClassAttribute(); return $this->tag->render(); } at TYPO3\CMS\Fluid\ViewHelpers\Form\PasswordViewHelper->render() at call_user_func(array(object(TYPO3\CMS\Fluid\ViewHelpers\Form\PasswordViewHelper), 'render')) in /var/www/html/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractViewHelper.php line 264 */ protected function callRenderMethod() { if (method_exists($this, 'render')) { return call_user_func([$this, 'render']); } if ((new \ReflectionMethod($this, 'renderStatic'))->getDeclaringClass()->getName() !== AbstractViewHelper::class) { // Method is safe to call - will not recurse through ViewHelperInvoker via the default // implementation of renderStatic() on this class. at TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper->callRenderMethod() in /var/www/html/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractViewHelper.php line 252 { $this->validateArguments(); $this->initialize(); return $this->callRenderMethod(); } /** * Call the render() method and handle errors. at TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper->initializeArgumentsAndRender() in /var/www/html/vendor/typo3fluid/fluid/src/Core/ViewHelper/ViewHelperInvoker.php line 79 } $viewHelper->setRenderingContext($renderingContext); $viewHelper->setArguments($evaluatedArguments); $viewHelper->handleAdditionalArguments($undeclaredArguments); return $viewHelper->initializeArgumentsAndRender(); } catch (Exception $error) { return $renderingContext->getErrorHandler()->handleViewHelperError($error); } } at TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInvoker->invoke('TYPO3\\CMS\\Fluid\\ViewHelpers\\Form\\PasswordViewHelper', array('additionalAttributes' => '', 'data' => null, 'aria' => null, 'name' => null, 'value' => null, 'property' => 'advancedpassword-1.password', 'disabled' => null, 'maxlength' => null, 'placeholder' => null, 'readonly' => null, 'autocomplete' => null, 'size' => null, 'errorClass' => 'error', 'class' => 'input-medium form-control', 'dir' => null, 'id' => 'xxx-1-advancedpassword-1', 'lang' => null, 'style' => null, 'title' => null, 'accesskey' => null, 'tabindex' => null, 'onclick' => null), object(TYPO3\CMS\Fluid\Core\Rendering\RenderingContext), object(Closure)) in /var/www/html/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractViewHelper.php line 524 */ public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) { $viewHelperClassName = get_called_class(); return $renderingContext->getViewHelperInvoker()->invoke($viewHelperClassName, $arguments, $renderingContext, $renderChildrenClosure); } /** * Save the associated ViewHelper node in a static public class variable. at TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper::renderStatic(array('additionalAttributes' => '', 'data' => null, 'aria' => null, 'name' => null, 'value' => null, 'property' => 'advancedpassword-1.password', 'disabled' => null, 'maxlength' => null, 'placeholder' => null, 'readonly' => null, 'autocomplete' => null, 'size' => null, 'errorClass' => 'error', 'class' => 'input-medium form-control', 'dir' => null, 'id' => 'xxx-1-advancedpassword-1', 'lang' => null, 'style' => null, 'title' => null, 'accesskey' => null, 'tabindex' => null, 'onclick' => null), object(Closure), object(TYPO3\CMS\Fluid\Core\Rendering\RenderingContext)) in /var/www/html/var/cache/code/fluid_template/partial_AdvancedPassword_5fc9c3846dcca9980cf7256ba335450f77bde3b2.php line 110 );$arguments18['element'] = $renderingContext->getVariableProvider()->getByPath('element', $array20); $arguments18['property'] = 'fluidAdditionalAttributes'; $arguments10['additionalAttributes'] = TYPO3\CMS\Form\ViewHelpers\TranslateElementPropertyViewHelper::renderStatic($arguments18, $renderChildrenClosure19, $renderingContext); $output9 .= TYPO3\CMS\Fluid\ViewHelpers\Form\PasswordViewHelper::renderStatic($arguments10, $renderChildrenClosure11, $renderingContext); $output9 .= ' '; // Rendering ViewHelper TYPO3Fluid\Fluid\ViewHelpers\IfViewHelper
Actions