Bug #91401
closedFluid AbstractViewHelper::getArguments incompatibilities
0%
Description
In #90289 some compatibility code for Fluid 3.0 was added to TYPO3 8.7 which apparently break my project.
[14-May-2020 11:31:05 UTC] PHP Fatal error: Declaration of FluidTYPO3\Vhs\ViewHelpers\Menu\AbstractMenuViewHelper::getArguments() must be compatible with TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper::getArguments(): TYPO3Fluid\Fluid\Component\Argument\ArgumentCollection in .../public/typo3conf/ext/vhs/Classes/ViewHelpers/Menu/AbstractMenuViewHelper.php on line 21
The setup uses PHP 7.1 and vhs in version 4.2 which already has a getArguments method in the AbstractMenuViewHelper.
Additionally the code in the AbstractViewHelper::getArguments seems pretty weird:
public function getArguments(): ArgumentCollection
{
if (method_exists($this, 'registerRenderMethodArguments')) {
$this->registerRenderMethodArguments();
}
return parent::getArguments();
}
registerRenderMethodArguments exists in that class -> why do we need to check if it exists?
It calls parent::getArguments, but \TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper in version 2.6.6 of typo3fluid/fluid does not have that method, only Fluid 3 has it.
Updated by Andreas Kienast over 4 years ago
- Status changed from New to Needs Feedback
Hello,
Can you please try to upgrade EXT:vhs to version 6.0, where the offending code isn't available anymore?
Updated by Andreas Kießling over 4 years ago
That's what i'm testing right now..
Something seems to be off on that staging server with the error reporting / handling, since i did not get these errors in my local setup. (Or the local setup is screwed up)
Nevertheless that change probably should not have gotten merged in the late stage of 8.7.
I'm wondering who will run 8.7 with Fluid 3 :/
Updated by Oliver Hader over 4 years ago
- Related to Task #90289: AbstractViewHelper class of TYPO3 8.7 can be compatible with Fluid 3.0 with minor changes added
Updated by Andreas Kießling over 4 years ago
The vhs upgrade worked, imho we can close the issue.
Updated by Björn Jacob over 4 years ago
- Status changed from Needs Feedback to Closed
Closing as requested by the author. Thanks for your response mate!
Updated by Felix Buenemann over 4 years ago
I think this issue should be re-opened.
It broke multiple of our sites when upgrading from TYPO3 8.7.31 to 8.7.32.
Minor updates should only have non-breaking changes, so I think this is a bug, even if it can be fixed by upgrading the VHS ext.
Updated by Felix Buenemann over 4 years ago
As noted by me in #90289 the change of the return type of the TYPO3\CMS\Fluid\Core\ViewHelper::getArguments()
from array
(as stated in the doc comments), to ArgumentCollection
will break any downstream classes that implement their own getArguments()
, so while upgrading VHS might work in some projects I don't think it can be seen as the solution to the problem.
Instead it should be investigated wether the Fluid 3 support can be adapted to not break backwards compatibility.