Issue Bug New Orphaned

#78546CollectionValidator is not automatically assigned to ObjectStorage parameters of an action

Viktor Livakivskyi 11/02/16, 14:38 updated 11/02/16, 14:38

Description

Consider the following action:

/**
 * @param \Vendor\Ext\Domain\Model\MyModel $myModel
 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Vendor\Ext\Domain\Model\MyModel>    $myModelList
 */
public function objectStorageAction($myModel, $myModelList)

Validation of first argument is executed, also due to recursive validation sub-properties are validated too, including validation of ObjectStorages and elements inside of them.

Validation of second argument is not executed, and so no validation of elements is performed.

This can be fixed with annotation:

@validate $myModelList Collection(elementType=\Vendor\Ext\Domain\Model\MyModel)

But would be much more convenient, if ExtBase could detect it from @param definition.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[BUGFIX] CollectionValidator is not automatically assigned to ObjectStorage parameters of an action Resolves: #78546 Releases: main