Bug #88636

Controller action does not accept ObjectStorage<Model> parameter

Added by ondro no-lastname-given 8 months ago. Updated about 1 month ago.

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

0%

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

History

#1 Updated by Susanne Moog 7 months ago

  • Tags changed from extbase,ObjectStorageConverter to extbase,ObjectStorageConverter,CodingNight

#2 Updated by Alexander Schnitzler about 1 month ago

  • Status changed from New to Accepted
  • Assignee set to Alexander Schnitzler
  • Is Regression set to Yes

Accepted but unconfirmed.
Possible cause: ClassSchema does only gather element types in models for performance reasons.

Also available in: Atom PDF