From 8cac2d905bc2d7e629e9a99efaf362c005a5c0d4 Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Wed, 16 Oct 2024 17:00:18 +0300 Subject: [PATCH] Check for hasMany associations before rendering a tab --- .../CoreEnroller/src/Model/Table/AttributeCollectorsTable.php | 3 +-- app/src/Model/Table/EnrollmentFlowStepsTable.php | 3 ++- app/templates/element/subnavigation/tabList.php | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/plugins/CoreEnroller/src/Model/Table/AttributeCollectorsTable.php b/app/plugins/CoreEnroller/src/Model/Table/AttributeCollectorsTable.php index e7f74a3e0..2c7701b4c 100644 --- a/app/plugins/CoreEnroller/src/Model/Table/AttributeCollectorsTable.php +++ b/app/plugins/CoreEnroller/src/Model/Table/AttributeCollectorsTable.php @@ -89,8 +89,7 @@ public function initialize(array $config): void { 'EnrollmentFlowSteps' => ['edit', 'view'], 'CoreEnroller.AttributeCollectors' => ['edit'], 'CoreEnroller.EnrollmentAttributes' => ['index'], - ], - 'skipTab' => ['CoreEnroller.AttributeCollectors'] + ] ] ); diff --git a/app/src/Model/Table/EnrollmentFlowStepsTable.php b/app/src/Model/Table/EnrollmentFlowStepsTable.php index f84e47447..99f359388 100644 --- a/app/src/Model/Table/EnrollmentFlowStepsTable.php +++ b/app/src/Model/Table/EnrollmentFlowStepsTable.php @@ -41,13 +41,14 @@ class EnrollmentFlowStepsTable extends Table { use \App\Lib\Traits\AutoViewVarsTrait; use \App\Lib\Traits\ChangelogBehaviorTrait; use \App\Lib\Traits\CoLinkTrait; + use \App\Lib\Traits\LayoutTrait; use \App\Lib\Traits\PermissionsTrait; use \App\Lib\Traits\PluggableModelTrait; use \App\Lib\Traits\PrimaryLinkTrait; use \App\Lib\Traits\TabTrait; use \App\Lib\Traits\TableMetaTrait; use \App\Lib\Traits\ValidationTrait; - + /** * Perform Cake Model initialization. * diff --git a/app/templates/element/subnavigation/tabList.php b/app/templates/element/subnavigation/tabList.php index 706ae966d..5edb06e1f 100644 --- a/app/templates/element/subnavigation/tabList.php +++ b/app/templates/element/subnavigation/tabList.php @@ -51,7 +51,6 @@