Skip to content
Snippets Groups Projects
Commit 65099fb8 authored by Benni Mack's avatar Benni Mack
Browse files

[BUGFIX] Do not use LSB in <f:form.select>

<f:form.select.option> uses the FQDN::class
syntax, so late static binding (LSB) is leading
to side effects when extending <f:form.select>.

Using the self::class syntax in <f:form.select>
solves the issue.

Resolves: #88017
Releases: master, 9.5
Change-Id: Ic060267cdff06856d1aa0f76980124ecfc0967a5
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60436


Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarTobi Kretschmann <tobi@tobishome.de>
Reviewed-by: default avatarSteffen Frese <steffenf14@gmail.com>
Reviewed-by: default avatarJörg Bösche <typo3@joergboesche.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarTobi Kretschmann <tobi@tobishome.de>
Tested-by: default avatarJörg Bösche <typo3@joergboesche.de>
Tested-by: default avatarBenni Mack <benni@typo3.org>
parent 9487c117
Branches
Tags
No related merge requests found
......@@ -146,8 +146,9 @@ class SelectViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFie
}
// save the parent field name so that any child f:form.select.option
// tag will know to call registerFieldNameForFormTokenGeneration
// this is the reason why "self::class" is used instead of static::class (no LSB)
$this->viewHelperVariableContainer->addOrUpdate(
static::class,
self::class,
'registerFieldNameForFormTokenGeneration',
$name
);
......@@ -155,12 +156,12 @@ class SelectViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFie
$this->registerFieldNameForFormTokenGeneration($name);
}
$this->viewHelperVariableContainer->addOrUpdate(static::class, 'selectedValue', $this->getSelectedValue());
$this->viewHelperVariableContainer->addOrUpdate(self::class, 'selectedValue', $this->getSelectedValue());
$prependContent = $this->renderPrependOptionTag();
$tagContent = $this->renderOptionTags($options);
$childContent = $this->renderChildren();
$this->viewHelperVariableContainer->remove(static::class, 'selectedValue');
$this->viewHelperVariableContainer->remove(static::class, 'registerFieldNameForFormTokenGeneration');
$this->viewHelperVariableContainer->remove(self::class, 'selectedValue');
$this->viewHelperVariableContainer->remove(self::class, 'registerFieldNameForFormTokenGeneration');
if (isset($this->arguments['optionsAfterContent']) && $this->arguments['optionsAfterContent']) {
$tagContent = $childContent . $tagContent;
} else {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment