Bug #41533

Ignored object-validation in editAction when redirecting back from updateAction

Added by Simon Schick almost 3 years ago. Updated almost 3 years ago.

Status:Needs Feedback Start date:2012-10-02
Priority:Should have Due date:
Assigned To:- % Done:

0%

Category:-
Target version:-
PHP Version:5.3 Complexity:
Has patch:No Affected Flow version:FLOW3 1.1.0

Description

I tried to create a blog following The Definitive Guide.

I ran into the "problem" that I did not got the exception described on http://flow3.typo3.org/documentation/guide/partii/validation.html#validating-updated-arguments.

As I Tried updating a post with an empty title and submitting the form I got back to the editAction, seeing the form having an empty title-field.
In addition I saw the error-info "title: This property is required.".
So I did not have to add the annotation "@FLOW3\IgnoreValidation("$post")".

Before I added the annotations "@FLOW3\Validate(type="NotEmpty")" to the model, I saved a post having an empty title and I was not able to open this post in the edit-view.

Here's the source of the controller and the model: https://gist.github.com/3819948

History

#1 Updated by Sebastian Kurfuerst almost 3 years ago

  • Status changed from New to Needs Feedback

I think the behavior we implement currently is correct; it's just that the guide is incorrect at this point.

#2 Updated by Simon Schick almost 3 years ago

Hi, Sebastian

I don't know what is the correct way ... just that this is incompatible.

For me, too, it feels more natural to change the docs. Opening an edit-view having an invalid dataset should result in an error (unleast you have the ignoreValidation annotation) but getting back when the framework rejects a request, should be possible.

Facing this, there is a case, you covered now, that wouldn't be coverable if you'd have implemented it the way the documentation says.

Also available in: Atom PDF