From cefe3df9a37852974be9b4fa462d2cdf5fe34b6c Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Tue, 12 Mar 2024 23:20:05 +0200 Subject: [PATCH] Fix breadcrumb bug for delete action --- app/src/Controller/Component/BreadcrumbComponent.php | 4 ++-- app/src/Lib/Util/StringUtilities.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/Controller/Component/BreadcrumbComponent.php b/app/src/Controller/Component/BreadcrumbComponent.php index 8cf6c44f1..ec500e4af 100644 --- a/app/src/Controller/Component/BreadcrumbComponent.php +++ b/app/src/Controller/Component/BreadcrumbComponent.php @@ -241,8 +241,8 @@ public function injectPrimaryLink(object $link, bool $index=true, string $linkLa $mappedRequestAction; // We specifically need to check for the add action - if($mappedRequestAction == 'add') { - $breadcrumbAction = 'add'; + if($mappedRequestAction == 'add' || $mappedRequestAction == 'delete') { + $breadcrumbAction = $mappedRequestAction; } diff --git a/app/src/Lib/Util/StringUtilities.php b/app/src/Lib/Util/StringUtilities.php index 885288112..97437c183 100644 --- a/app/src/Lib/Util/StringUtilities.php +++ b/app/src/Lib/Util/StringUtilities.php @@ -183,7 +183,8 @@ public static function entityAndActionToTitle($entity, // The MVEA Models have a entityId. The one from the parent model. // We need to have a condition for this and exclude it. if($entity->id !== null - && $action != 'add' + && $action !== 'add' + && $action !== 'delete' && method_exists($linkTable, 'generateDisplayField')) { // We don't use a trait for this since each table will implement different logic