Skip to content

Commit

Permalink
Rename view variable creating conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Feb 5, 2025
1 parent a9cfa0c commit fc72caa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions app/src/Controller/MVEAController.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function beforeFilter(\Cake\Event\EventInterface $event) {
$personName = $Names->primaryName($externalIdentity->person_id);
$this->set('vv_person_name', $personName);
$this->set('vv_supertitle', $personName->full_name);
$this->set('vv_person_id', $externalIdentity->person_id);
$this->set('vv_mvea_person_id', $externalIdentity->person_id);
break;
case 'person_role_id':
$PersonRoles = $this->getTableLocator()->get('PersonRoles');
Expand All @@ -113,13 +113,13 @@ public function beforeFilter(\Cake\Event\EventInterface $event) {
$personName = $Names->primaryName($roleEntity->person_id);
$this->set('vv_person_name', $personName);
$this->set('vv_supertitle', $personName->full_name);
$this->set('vv_person_id', $roleEntity->person_id);
$this->set('vv_mvea_person_id', $roleEntity->person_id);
break;
case 'person_id':
$personName = $Names->primaryName((int)$primaryLink->value);
$this->set('vv_person_name', $personName);
$this->set('vv_supertitle', $personName->full_name);
$this->set('vv_person_id', $primaryLink->value);
$this->set('vv_mvea_person_id', $primaryLink->value);
break;
default;
break;
Expand Down
10 changes: 5 additions & 5 deletions app/templates/element/subnavigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
$curId = $this->request->getQuery($vv_primary_link);
$linkFilter = [$vv_primary_link => $curId];
// For top-level nav
if(!empty($vv_person_id)) {
$curId = $vv_person_id;
$linkFilter = ['person_id' => $vv_person_id];
if(!empty($vv_mvea_person_id)) {
$curId = $vv_mvea_person_id;
$linkFilter = ['person_id' => $vv_mvea_person_id];
}
} elseif (!empty($vv_obj)) {
// This will work for most top-level edit views
Expand All @@ -55,8 +55,8 @@
// these have been explicitly set in the $subnav array in fields-nav.inc, so just use them.
$curId = $tabsId;
$navController = $tabsController;
} elseif(!empty($vv_person_id)) {
$curId = $vv_person_id;
} elseif(!empty($vv_mvea_person_id)) {
$curId = $vv_mvea_person_id;
} elseif(
($active == 'plugin' || (!empty($vv_primary_link) && $vv_primary_link == 'enrollment_flow_id'))
&& !empty($vv_primary_link_obj)
Expand Down
2 changes: 1 addition & 1 deletion app/templates/element/subnavigation/statusBadge.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
return;
}

$personId = $vv_person_id
$personId = $vv_mvea_person_id
?? $this->request->getQuery('person_id')
?? $vv_obj?->person_id
?? $vv_obj?->id;
Expand Down
2 changes: 1 addition & 1 deletion app/templates/element/subnavigation/supertitle.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* Person with deep nested dependency
*/

$person_id = (int)($vv_person_id ?? $vv_obj?->person_id ?? $this->getRequest()->getQuery('person_id'));
$person_id = (int)($vv_mvea_person_id ?? $vv_obj?->person_id ?? $this->getRequest()->getQuery('person_id'));
if ($person_id) {
$personFullName = $this->Tab->getPersonPrimaryName($person_id);
}
Expand Down

0 comments on commit fc72caa

Please sign in to comment.