[Flow] Validation > Exception instead of going back to newAction

Andreas Wolf aw at foundata.net
Sat Jan 4 14:19:21 CET 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Axel,

Am 06.12.2013 10:06, schrieb Axel Wüstemann:
> protected function initializeCreateAction() { $depositInspection =
> $this->request->getArgument('depositInspection'); 
> $depositInspection['date'] = $this->__buildDateTime(); 
> $this->request->setArgument('depositInspection',
> $depositInspection); }
> 
> This did not work:
> 
> It is not allowed to map property "date". You need to use 
> $propertyMappingConfiguration->allowProperties('date') to enable
> mapping of this property
> 
> So I added:
> 
> $propertyMappingConfiguration = 
> $this->arguments->getArgument('depositInspection')->getPropertyMappingConfiguration();
>
> 
$propertyMappingConfiguration->allowProperties('date');
> 
> But I don't know, why this might be nessecary. It would be great,
> if you could explain it a bit ;=)

I'm not 100% sure (the property mapping code is not so easy to
understand and it's been a month since I dug into it), but as far as I
know, you're by default not allowed to map properties that were not
present in your form (see the __trustedProperties field in your form).
That's the reason you have to manually allow the date property here.

Cheers
Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iF4EAREIAAYFAlLIClgACgkQVRefK2MMWg5VbQEAqsPF50gRCGBXzIIxT4+Wd6hX
rCm/tcbjYjQkMShCxEMA/AqOVZ1BEMgHn/UhALPfdG+KEj/oBfyxtQBwMRjRl2ab
=dY70
-----END PGP SIGNATURE-----


More information about the Flow mailing list