Skip to content

Commit

Permalink
Check for hasMany associations before rendering a tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis authored and arlen committed Dec 19, 2024
1 parent e46e9e4 commit 8cac2d9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ public function initialize(array $config): void {
'EnrollmentFlowSteps' => ['edit', 'view'],
'CoreEnroller.AttributeCollectors' => ['edit'],
'CoreEnroller.EnrollmentAttributes' => ['index'],
],
'skipTab' => ['CoreEnroller.AttributeCollectors']
]
]
);

Expand Down
3 changes: 2 additions & 1 deletion app/src/Model/Table/EnrollmentFlowStepsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
1 change: 0 additions & 1 deletion app/templates/element/subnavigation/tabList.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
<!-- if a tab has no fields do not render skip -->
<li class="nav-item">
<?php
$curId = $this->Tab->getCurrentId($tab, $isNested);
// Calculate Tab Title
$title = $this->element('subnavigation/tabTitle', compact('tab', 'curId', 'isNested'));
// Construct Target URL
Expand Down

0 comments on commit 8cac2d9

Please sign in to comment.