[FLOW3-general] Flow and validation when deleting
David Sporer
david.sporer at gmail.com
Mon Feb 4 15:24:10 CET 2013
Hi,
another option is to specify default values.
/** * The label color * @var string *
@FLOW3\Validate(type="StringLength", options={"minimum"=6, "maximum"=6
}) * @ORM\Column(options={"default" = "000000"}) */
protected $labelColor = '000000';
Best Regards
David
2013/2/4 Steffen Wickham <steffen at gaming-inc.de>
> Hi Stephan,
>
> to answer your last question: It's a feature.
> As the MVC framework doesn't know what kind of action is invoked it has
> to validate the model everytime. If you change your model (including
> validation) you have to make sure to add missing values or you can
> simply use the "@Flow\IgnoreValidation("$variable")" annotation in the
> PhpDoc block before your deleteAction method. It's described in the
> documation part II at
>
> http://docs.typo3.org/flow/TYPO3FlowDocumentation/TheDefinitiveGuide/PartII/Validation.html
> (very last example at the bottom of the page).
>
> Greetings
> Steffen
>
>
> Am 04.02.2013 13:06, schrieb Stephan Vidar:
> > Hi,
> >
> > I have a model with propertys. Later I added a validation of a
> > property of a model (location).
> >
> > /**
> > * The location
> > * @var string
> > * @Flow\Validate(type="NotEmpty")
> > */
> > protected $location;
> >
> > Existing records with an empty string in this property can no longer
> > be deleted because the validation to fail:
> >
> > An error occurred while trying to call
> > ...Controller\ConcertController->deleteAction(). Error for
> > concert.location: This property is required.
> >
> > Is it a bug or a feature?
> >
> > Thx, Stephan
> > _______________________________________________
> > FLOW3-general mailing list
> > FLOW3-general at lists.typo3.org
> > http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
>
> _______________________________________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
>
--
If you're interested in my work you can follow me or my current project
@sporerd <https://twitter.com/sporerd> and
@PasscreatorDe<https://twitter.com/PasscreatorDe>
More information about the FLOW3-general
mailing list