[TYPO3-mvc] The given subject was not a collection..

Philipp Wrann philippwrann at gmail.com
Thu Mar 27 14:03:43 CET 2014


Cant be...

In my controller i have

@param array $request
@ignorevalidation $request

and do the validation manually

my model is hinted like:

/**
 * @var \Vendor\Extension\Domain\Model\Package
 */
protected $package;

And this property gets validated, but it is a passed entity, it should not be created or validated, it should only be set

The property that is validated as Collection is hinted like:

	
/**
 * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Vendor\Extension\Domain\Model\Location>
 * @transient
 */
protected $children;

its property path woulds be

request.package.location.children

it is transient because i dont have m:m for that case, its just a first-level-cache property

Additionally the description gets validated

The validation is made for an allready created and persisted entity, it should only be loaded and if it exists the property
request.package = 123 IS VALID

My fix here is, that i only check the first 2 levels of errors in the validationResult.

I think the validation just loops to deep in the nested modle, even if a reference is passed - the passed reference is validated, this should not happen, only new objects should be validated.

The second problem is, that a collection tagged transient is validated and can never be valid because its transient and will not be delivered in any case.


More information about the TYPO3-project-typo3v4mvc mailing list