mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-09-19 18:36:12 +02:00

[BUGFIX] Skip validation where validation makes no sense (#877)

When creating a new tea record in the FE, or when editing one,
the tea model provided to the form is not necessarily valid
(and we need to accept invalid models if the following action
rejects the model due to a valiation error).
This commit is contained in:
Oliver Klee 2023-06-23 12:07:54 +02:00 committed by GitHub
parent cda38af84b
commit a6869c6fee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,6 +45,9 @@ class FrontEndEditorController extends ActionController
return $this->context->getPropertyFromAspect('frontend.user', 'id');
}
/**
* @Extbase\IgnoreValidation("tea")
*/
public function editAction(Tea $tea): ResponseInterface
{
$this->checkIfUserIsOwner($tea);
@ -73,6 +76,9 @@ class FrontEndEditorController extends ActionController
return $this->redirect('index');
}
/**
* @Extbase\IgnoreValidation("tea")
*/
public function newAction(?Tea $tea = null): ResponseInterface
{
// Note: We are using `makeInstance` here instead of `new` to allow for XCLASSing.