Skip to content

Commit

Permalink
USAGOV-1996: USAGOV-1996 - Code review update
Browse files Browse the repository at this point in the history
  • Loading branch information
Dale Frey committed Nov 13, 2024
1 parent be501f3 commit 17b80c0
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions web/modules/custom/usagov_wizard/usagov_wizard.module
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,8 @@ function usagov_wizard_preprocess_html(&$variables) {
$variables['wizardTitleUrl'] = $wizard_title_url;
}
else {
// Lookup the top-most taxonomy parent
$topParent = $taxonomy_term;
while (!empty($topParent->parent)) {
$thisParent = Term::load($topParent->parent->target_id);
if (empty($thisParent)) {
break;
}
$topParent = $thisParent;
}
$parents = $menuChecker->getTermParents($taxonomy_term);
$topParent = Term::load($parents[0]);

$variables['wizardTitle'] = $topParent->getName();
$variables['wizardTitleUrl'] = \Drupal::service('path_alias.manager')->getAliasByPath('/taxonomy/term/' . $topParent->id());
Expand Down

0 comments on commit 17b80c0

Please sign in to comment.