Bug #47232

Property mapping fails for Account::roles

Added by Philipp Maier almost 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Must have
Assignee:
Category:
Property
Start date:
2013-04-15
Due date:
% Done:

100%

Estimated time:
PHP Version:
5.4
Has patch:
No
Complexity:
easy

Description

Hi,

following error is thrown when the PropertyMapper tries to map the roles.

#1297759968: Exception while property mapping for target type "SomeModel", at property path "accounts.0": Catchable Fatal Error: Argument 1 passed to TYPO3\Flow\Persistence\Doctrine\Proxies\__CG__\TYPO3\Flow\Security\Account::setRoles() must be an array, object given.

This is mainly because the typehint in the function setRoles is <array> while the property itself is annotated as Doctrine Collection.
Changing the typehint to \Doctrine\Common\Collections\Collection seems to fixes this problem.

#1

Updated by Philipp Maier almost 8 years ago

  • Assignee set to Philipp Maier
#2

Updated by Gerrit Code Review almost 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19996

#3

Updated by Philipp Maier almost 8 years ago

For the time being a TypeConverter can be used as a workaround.

https://gist.github.com/Akii/07e5678798db06493199

#4

Updated by Gerrit Code Review almost 8 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/19996

#5

Updated by Gerrit Code Review almost 8 years ago

Patch set 1 for branch 2.0 has been pushed to the review server.
It is available at https://review.typo3.org/19999

#6

Updated by Philipp Maier almost 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF