[Flow] Validation > Exception instead of going back to newAction
Axel Wüstemann
awu at qbus.de
Fri Dec 6 10:26:20 CET 2013
Thanks Stephen!
The problem is, that the validation runs into an exceptions instead of
going back to the newAction.
My object hast a property date. In the form I need to split the date
into __date and __time.
The MVC base validate will not act, because ther is nor date property to
validate. So it comes to the persistence valitation wich throws an exeption.
I tried to build a date property in initializeCreateAction, wich works
now, but it doesn't solve the validation problem. I don't understand why.
Axel
Am 06.12.2013 10:18, schrieb Stephen Bungert:
> Not sure if this will help,
>
> but if I want to change the date fields in my update actions I have to add
> the folowing in the initializeUpdateAction.
>
>
>
> /**
> * Initialise the update action.
> *
> * @return void
> */
> public function initializeUpdateAction() {
> $mappingConf =
> $this->arguments['book']->getPropertyMappingConfiguration();
> // Allow creation for the following related fields
> $mappingConf->allowProperties('genres', 'image');
> $mappingConf->setTypeConverterOption(
> 'TYPO3\Flow\Property\TypeConverter\PersistentObjectConverter',
> \TYPO3\Flow\Property\TypeConverter\PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED,
> TRUE
> );
> // Set format for Datetime fields:
> $mappingConf->forProperty('publishedDate')->setTypeConverterOption('TYPO3\Flow\Property\TypeConverter\DateTimeConverter',
> \TYPO3\Flow\Property\TypeConverter\DateTimeConverter::CONFIGURATION_DATE_FORMAT,
> $this->settings['global']['dateFormat']);
> $mappingConf->forProperty('created')->setTypeConverterOption('TYPO3\Flow\Property\TypeConverter\DateTimeConverter',
> \TYPO3\Flow\Property\TypeConverter\DateTimeConverter::CONFIGURATION_DATE_FORMAT,
> $this->settings['global']['dateFormat']);
> $mappingConf->forProperty('updated')->setTypeConverterOption('TYPO3\Flow\Property\TypeConverter\DateTimeConverter',
> \TYPO3\Flow\Property\TypeConverter\DateTimeConverter::CONFIGURATION_DATE_FORMAT,
> $this->settings['global']['dateFormat']);
> }
>
>
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
>
--
Qbus Werbeagentur GmbH
18055 Rostock, Heiligengeisthof 5
Tel: 0381 4 61 39 - 10 | Fax: - 22
21029 Hamburg, Chrysanderstraße 69A
Tel: 040 60 94 59 75
Mobil: 0179 46 455 46
www.xing.com/profile/Axel_Wuestemann
www.issuu.com/QbusAgentur/docs/qbus-referenzen?mode=embed
Handelsregister: HRB 11218 beim Amtsgericht Rostock Sitz der
Gesellschaft: Hansestadt Rostock
Geschäftsführer: Dipl.-Ing. Axel Wüstemann
www.qbus.de | www.qbus.de/qblog
www.facebook.com/QbusAgentur
More information about the Flow
mailing list