Project

General

Profile

Actions

Bug #88636

open

Controller action does not accept ObjectStorage<Model> parameter

Added by ondro no-lastname-given over 5 years ago. Updated almost 5 years ago.

Status:
Accepted
Priority:
Should have
Category:
Extbase
Target version:
-
Start date:
2019-06-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
extbase,ObjectStorageConverter,CodingNight
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

When I use parameter annotation for controller action like this:

    /**
     * @param ObjectStorage<Model> $param
     */
    public function someAction(ObjectStorage $param = null)
    {
        //...
    }

In ObjectStorageConverter target type is ObjectStorag and <Model> is stripped off so converter is not able to handle converting.
Looks like it's stripped off in TYPO3\CMS\Extbase\Mvc\Controller::initializeActionMethodArguments by reflection service

$methodParameters = $this->reflectionService
                ->getClassSchema(static::class)
                ->getMethod($this->actionMethodName)['params'] ?? [];

See slack thread about this [[https://typo3.slack.com/archives/C0CRS7RFH/p1561101916230200]]

PHP: 7.2
Typo3: 9.5.7

Actions

Also available in: Atom PDF