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 #1

Updated by Susanne Moog over 5 years ago

  • Tags changed from extbase,ObjectStorageConverter to extbase,ObjectStorageConverter,CodingNight
Actions #2

Updated by Alexander Schnitzler almost 5 years 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.

Actions

Also available in: Atom PDF