mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 10:33:49 +00:00
fix error in delete action: route name, misplaced 404 errors
This commit is contained in:
@@ -219,6 +219,10 @@ class SingleTaskController extends Controller
|
||||
$taskRepository = $this->get('chill_task.single_task_repository');
|
||||
|
||||
$task = $taskRepository->find($id);
|
||||
|
||||
if (!$task) {
|
||||
throw $this->createNotFoundException('Unable to find Task entity.');
|
||||
}
|
||||
|
||||
if (!is_null($task->getPerson() === !null)) {
|
||||
|
||||
@@ -240,10 +244,6 @@ class SingleTaskController extends Controller
|
||||
$this->denyAccessUnlessGranted(TaskVoter::DELETE, $task, 'You are not '
|
||||
. 'allowed to delete this task');
|
||||
|
||||
if (!$task) {
|
||||
throw $this->createNotFoundException('Unable to find Task entity.');
|
||||
}
|
||||
|
||||
$form = $this->createDeleteForm($id);
|
||||
|
||||
if ($request->getMethod() === Request::METHOD_DELETE) {
|
||||
@@ -271,7 +271,7 @@ class SingleTaskController extends Controller
|
||||
->trans("The task has been successfully removed."));
|
||||
|
||||
return $this->redirect($this->generateUrl(
|
||||
'chill_task_task_list_by_person', array(
|
||||
'chill_task_singletask_list', array(
|
||||
'person_id' => $personId
|
||||
)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user