mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix error in delete action: route name, misplaced 404 errors
This commit is contained in:
parent
9fc55054cb
commit
0df80041fb
@ -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
|
||||
)));
|
||||
}
|
||||
|
@ -66,6 +66,7 @@ cancel: annuler
|
||||
|
||||
#Flash messages
|
||||
'The task is created': 'La tâche a été créée'
|
||||
'There is no tasks.': Aucune tâche.
|
||||
'The task has been successfully removed.': 'La tâche a bien été supprimée'
|
||||
'This form contains errors': 'Ce formulaire contient des erreurs'
|
||||
'The task has been updated': 'La tâche a été mise à jour'
|
||||
|
Loading…
x
Reference in New Issue
Block a user