From a0722c6d149b253a320976a64aad6e57ab1cccd7 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 5 Aug 2021 18:19:19 +0200 Subject: Don't check return value of insert/delete methods Don't check the return value of the Repository's "insert" and "delete" methods in the administration controllers for creating and modifying entities since a PDOException is thrown if an error occurs. --- admin/user/delete.php | 5 ++--- admin/user/insert.php | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'admin/user') diff --git a/admin/user/delete.php b/admin/user/delete.php index 31389a2..1a7628c 100644 --- a/admin/user/delete.php +++ b/admin/user/delete.php @@ -28,9 +28,8 @@ if(!$User = $UserRepository->find(HTTP::GET('id'))) { if(HTTP::issetPOST('delete')) { if(HTTP::issetPOST(['token' => Application::getSecurityToken()])) { try { - if($UserRepository->delete($User)) { - HTTP::redirect(Application::getAdminURL('user/')); - } + $UserRepository->delete($User); + HTTP::redirect(Application::getAdminURL('user/')); } catch(PDOException $Exception) { $messages[] = $Exception->getMessage(); } diff --git a/admin/user/insert.php b/admin/user/insert.php index 48cbf65..c337e21 100644 --- a/admin/user/insert.php +++ b/admin/user/insert.php @@ -36,9 +36,8 @@ if(HTTP::issetPOST('insert')) { if(HTTP::issetPOST(['token' => Application::getSecurityToken()])) { try { - if($UserRepository->insert($User)) { - HTTP::redirect(Application::getAdminURL('user/')); - } + $UserRepository->insert($User); + HTTP::redirect(Application::getAdminURL('user/')); } catch(PDOException $Exception) { $messages[] = $Exception->getMessage(); } -- cgit v1.2.3