craue/CraueFormFlowBundle — pull request #98 by craue (2013-11-09 11:49:07+00:00)
Title: [RFC] ensure that validation errors on previous steps are not ignored

Let's take this entity as data object for a flow with three steps:

```php
/**
* @Assert\Callback(methods={"isTitleValid"}, groups={"flow_createTopic_step1"})
*/
class Topic {

public $title;

public function isTitleValid(ExecutionContextInterface $context) {
// TODO: I really have to check this soon.
//	if ($this->isThereSomethingWrongWithTheTitle()) {
//	$context->addViolation('Oh no!');
//	}
}

}
```

A user starts the flow, enters a title in step 1, submits the form, succeeds to step 2. Now the dev decides to uncomment the lines above and deploys the code. The user submits the form for step 2 and succeeds to step 3. The forms of step 1 and 2 are validated. Although the title given in step 1 now results in a validation error, this error message is not shown to the user and he could just finish the flow with (now) invalid data.

This PR fixes this by explicitly checking the forms of previous steps for errors when `$flow->isValid($form)` is called, and adds a generic error message to the current form: "The form for step 1 is invalid. Please go back and try to resubmit it." Once the user does that, he will see the "Oh no!" validation error.

Note: Validating the forms of previous steps is already done by the Form component when binding the data of previous steps. We'll just check if there are any errors.

TODO:
- [ ] provide translations of the new validation error message for all locales currently included