diff --git a/typo3/sysext/form/Classes/Domain/Model/FormElements/AbstractFormElement.php b/typo3/sysext/form/Classes/Domain/Model/FormElements/AbstractFormElement.php index 6fa1bcfc769609f3dfb03a62d321b4264cc57c27..da183ff66b6fe2488ea3bf330b4583eb1f691b18 100644 --- a/typo3/sysext/form/Classes/Domain/Model/FormElements/AbstractFormElement.php +++ b/typo3/sysext/form/Classes/Domain/Model/FormElements/AbstractFormElement.php @@ -98,6 +98,21 @@ abstract class AbstractFormElement extends AbstractRenderable implements FormEle return lcfirst($uniqueIdentifier); } + public function setOptions(array $options, bool $resetValidators = false) + { + if (isset($options['defaultValue'])) { + $this->setDefaultValue($options['defaultValue']); + } + + if (isset($options['properties'])) { + foreach ($options['properties'] as $key => $value) { + $this->setProperty($key, $value); + } + } + + parent::setOptions($options, $resetValidators); + } + /** * Get the default value of the element * diff --git a/typo3/sysext/form/Classes/Domain/Model/FormElements/Section.php b/typo3/sysext/form/Classes/Domain/Model/FormElements/Section.php index 06d8b07e29cc64c3cb81912b5b074939e1c99cec..7a4523f0b15c9ec84681ee8e15d804ef4cd59409 100644 --- a/typo3/sysext/form/Classes/Domain/Model/FormElements/Section.php +++ b/typo3/sysext/form/Classes/Domain/Model/FormElements/Section.php @@ -61,6 +61,17 @@ class Section extends AbstractSection implements FormElementInterface } } + public function setOptions(array $options, bool $resetValidators = false) + { + if (isset($options['properties'])) { + foreach ($options['properties'] as $key => $value) { + $this->setProperty($key, $value); + } + } + + parent::setOptions($options, $resetValidators); + } + /** * Returns a unique identifier of this element. * While element identifiers are only unique within one form, diff --git a/typo3/sysext/form/Classes/Domain/Model/Renderable/AbstractRenderable.php b/typo3/sysext/form/Classes/Domain/Model/Renderable/AbstractRenderable.php index ac73611268c9799db6c28c47ffe59cb3d426cf1c..d88ca28a4201db9de544d67930585855aeb8f7f8 100644 --- a/typo3/sysext/form/Classes/Domain/Model/Renderable/AbstractRenderable.php +++ b/typo3/sysext/form/Classes/Domain/Model/Renderable/AbstractRenderable.php @@ -144,16 +144,6 @@ abstract class AbstractRenderable implements RenderableInterface, VariableRender $this->setLabel($options['label']); } - if (isset($options['defaultValue'])) { - $this->setDefaultValue($options['defaultValue']); - } - - if (isset($options['properties'])) { - foreach ($options['properties'] as $key => $value) { - $this->setProperty($key, $value); - } - } - if (isset($options['renderingOptions'])) { foreach ($options['renderingOptions'] as $key => $value) { $this->setRenderingOption($key, $value); @@ -414,16 +404,6 @@ abstract class AbstractRenderable implements RenderableInterface, VariableRender $this->label = $label; } - public function setDefaultValue($defaultValue) - { - // todo: this method must either be abstract and implemented in sub classes or get a proper method body. - } - - public function setProperty(string $key, $value) - { - // todo: this method must either be abstract and implemented in sub classes or get a proper method body. - } - /** * Get the templateName name of the renderable *