diff --git a/Classes/ViewHelpers/Condition/Form/HasValidatorViewHelper.php b/Classes/ViewHelpers/Condition/Form/HasValidatorViewHelper.php index 6557ebb0b..51d218e7c 100644 --- a/Classes/ViewHelpers/Condition/Form/HasValidatorViewHelper.php +++ b/Classes/ViewHelpers/Condition/Form/HasValidatorViewHelper.php @@ -50,31 +50,17 @@ public function initializeArguments() $this->registerArgument( 'validatorName', 'string', - 'The class name of the Validator that indicates the property is required.' + 'The name of the validator that must exist for the condition to be true.', + true ); $this->registerArgument( 'object', DomainObjectInterface::class, - 'Optional object - if not specified, grabs the associated form object.' + 'Optional object - if not specified, grabs the associated form object.', + true ); } - /** - * @param ViewHelperVariableContainer $viewHelperVariableContainer - * @param string $formClassName - * @return DomainObjectInterface|NULL - */ - protected static function getFormObject($viewHelperVariableContainer, $formClassName = FormViewHelper::class) - { - if (true === $viewHelperVariableContainer->exists($formClassName, 'formObject')) { - return $viewHelperVariableContainer->get($formClassName, 'formObject'); - } - if (self::ALTERNATE_FORM_VIEWHELPER_CLASSNAME !== $formClassName) { - return self::getFormObject($viewHelperVariableContainer, self::ALTERNATE_FORM_VIEWHELPER_CLASSNAME); - } - return null; - } - /** * @param array $arguments * @return boolean @@ -90,9 +76,6 @@ protected static function evaluateCondition($arguments = null) $validatorName = isset($arguments['validatorName']) ? $arguments['validatorName'] : null; $object = isset($arguments['object']) ? $arguments['object'] : null; - if (null === $object) { - $object = static::getFormObject($renderingContext->getViewHelperVariableContainer()); - } $className = get_class($object); if (false !== strpos($property, '.')) { $pathSegments = explode('.', $property);