Bug #91401

Fluid AbstractViewHelper::getArguments incompatibilities

Added by Andreas Kiessling about 1 year ago. Updated 12 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-05-14
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Related issues

Related to TYPO3 Core - Task #90289: AbstractViewHelper class of TYPO3 8.7 can be compatible with Fluid 3.0 with minor changesClosed2020-02-01

Actions
#1

Updated by Andreas Fernandez about 1 year 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?

#2

Updated by Andreas Kiessling about 1 year 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 :/

#3

Updated by Oliver Hader about 1 year ago

  • Related to Task #90289: AbstractViewHelper class of TYPO3 8.7 can be compatible with Fluid 3.0 with minor changes added
#4

Updated by Andreas Kiessling about 1 year ago

The vhs upgrade worked, imho we can close the issue.

#5

Updated by Bjoern Jacob about 1 year ago

  • Status changed from Needs Feedback to Closed

Closing as requested by the author. Thanks for your response mate!

#6

Updated by Felix Buenemann 12 months 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.

#7

Updated by Felix Buenemann 12 months 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.

Also available in: Atom PDF