Bug #66926
closedRequest-Arguments are lost when validation fails
0%
Description
In an extbase controller with a new and create action, the request arguments are lost, if the validation on the create-action reports errors and redirects to the new action. If the validation is successfull the Arguments are not lost.
This behavior has changed from former Typo3 Versions (6.0) where the arguments existed after redirect/validation.
I tried to figure out where this happens, but could not resolve the problem due to lack of knowledge on the extbase core. I got down to it, that in the first loop of the dispatcher->process the request is correct and contains the arguments, in the second loop the arguments are empty.
The original request ( $this->request->getOriginalRequest() ) contains the arguments but I think the arguments should not get lost during validation/redirection.
Updated by Christian Kuhn over 9 years ago
- Status changed from New to Closed
This is by intention and was changed in extbase/fluid/flow a while ago:
The former solution had the issue that not validated models are given around, which is not cool from an integrity point of view. The logic was changed that the "broken" objects are discarded and no longer given to the referrer action. The arguments are given to fluid directly, so it can display them again as new default values. If the controller needs to do stuff with the arguments, they can be found in $this->request->getOriginalRequest() or similar.
Updated by Moritz Ahl about 9 years ago
This should be reflected in the documentation. The documentation implies that the object is being passed back to the originating action which makes it nescessary to add the "ignorevalidation" annotation. That leads to unnescessary confusion:
https://docs.typo3.org/typo3cms/ExtbaseFluidBook/3-BlogExample/11-Alternative-route-creating-a-new-posting.html
Updated by Stephan Großberndt about 9 years ago
Please propose an according update to the documentation using the "Edit me on github" link in the document.
Updated by Thomas Prangenberg over 7 years ago
The documentation still describes the wrong behaviour in multiple passages, e.g. https://docs.typo3.org/typo3cms/ExtbaseFluidBook/7-Controllers/1-Creating-Controllers-and-Actions.html#flow-pattern-creating-a-new-domain-object
This should really get either updated or removed since the documentaion causes a lot of confusion, ending up with developers getting stuck.