[FLOW3-general] Transient properties and property mapping

Karsten Dambekalns karsten at typo3.org
Mon Apr 30 14:38:22 CEST 2012


Hi.

On 26.04.12 23:24, Alexander Berl wrote:
> I'm currently in the process of creating a user registration process for a web page and therefore have a user model with properties name, email, password with validators and an authentication account.
> Since I only need the password for user creation and for password change (and because it's bad storing plaintext passwords) I want this property to be transient to the persistence and only be stored inside the account object, which I achieved with the @FLOW3\Transient annotation.
> However, on the create action I receive a property mapping Exception:
> 
> #1297759968: Exception while property mapping at property path "": Property "password" was not found in target object of type "Foo\Bar\Domain\Model\User"
> 
> The problem here is, that the property is skipped in reflection due to the Transient annotation (see ReflectionService->addPropertiesToClassSchema) and therefore also cannot be property mapped.

It is only skipped when building a ClassSchema for the class, but
anything else to learn about the property will be known to the
ReflectionService anyway.

So property mapping should work fine… but it seems it doesn't. That is a
bug (missing feature?), could you file an issue?

A workaround for the time being: as soon as the account has been
created, set your password property to NULL (instead of marking it
transient).


Regards,
Karsten
-- 
Karsten Dambekalns
TYPO3 Core Developer, FLOW3 / Phoenix Team

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the FLOW3-general mailing list