Bug #41533

Ignored object-validation in editAction when redirecting back from updateAction

Added by Simon Schick about 9 years ago. Updated about 9 years ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-10-02
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.3
Has patch:
No
Complexity:

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

#1

Updated by Sebastian Kurfuerst about 9 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 about 9 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