[Flow] lost data through validation cycle on create

Tomas M flow at 46dev.de
Wed May 27 14:34:17 CEST 2015


Hello again!

I've got another problem while create an new dataset.

My model looks like this i.e.:

/**
 * @var string
 * @Flow\Validate(type="Text")
 * @Flow\Validate(type="StringLength", options={ "minimum"=15, "maximum"=80 })
 * @Flow\Validate(type="NotEmpty")
 * @ORM\Column(length=80)
 * @ORM\OrderBy({"title" = "ASC"})	 
 */
protected $title;

/**
 * visible is an on/off switch to show/hide the title
 *
 * @var integer
 * @Flow\Validate(type="integer")
 * @ORM\Column(type="integer", options={"unsigned":true, "default":1},nullable=true)
 */
protected $visible = 1;


The property "$visible" is represented by a checkbox in then create-/new-form.

It should be "checked" by default.
 
The dataset correct persists if the user provides a title with length =>15  and <80 chars.
This works as expected.

If the user "unchecks" the checkbox and provides a title with less than 15 chars
or more than 80 chars, validation loops back to the form.
This works as expected too.

The pitfall: the checkbox is SET again!

In this simple example it doesn't matter but in a complex form
its really annoying!

BTW: I got a very similar problem with properties of type "datetime"...

After hours of experiementing and debugging I've decided to post it here.

Note: this problem exists only on create a new dataset!

Any idea or hint is welcome! ;-)




More information about the Flow mailing list