Skip to content

Commit

Permalink
IBX-1648: Added redirect when the trash form has any error (#2074)
Browse files Browse the repository at this point in the history
* IBX-1648: Added redirect when the trash form has any error

* IBX-1648: Corrected CS

* Added condition to check if a location is not null

* Corrected CS

Co-authored-by: Mateusz Dębiński <mateusz.debinski@ibexa.co>
  • Loading branch information
mateuszdebinski and Mateusz Dębiński authored Dec 1, 2022
1 parent 500e932 commit e4f16e7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bundle/Controller/LocationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,13 @@ public function trashAction(Request $request): Response
if ($result instanceof Response) {
return $result;
}

$data = $form->getData();
$location = $data->getLocation();

if ($location !== null) {
return $this->redirectToLocation($location);
}
}

return $this->redirect($this->generateUrl('ezplatform.trash.list'));
Expand Down

0 comments on commit e4f16e7

Please sign in to comment.