From c82ed6585a49aec2eca3a8901439123622ca3abc Mon Sep 17 00:00:00 2001 From: Igor Biki <ibiki@uwaterloo.ca> Date: Tue, 25 Jan 2022 09:01:34 -0500 Subject: [PATCH] ISTWCMS-5176: Updating homepage check function. --- src/Service/UWService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Service/UWService.php b/src/Service/UWService.php index 9b3cf295..0b33fa3e 100644 --- a/src/Service/UWService.php +++ b/src/Service/UWService.php @@ -503,8 +503,9 @@ class UWService implements UWServiceInterface { */ public static function nodeIsHomePage(int $nid): bool { $front_page_path = \Drupal::configFactory()->get('system.site')->get('page.front'); + $front_page_alias = \Drupal::service('path_alias.manager')->getAliasByPath($front_page_path); $node_alias = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $nid); - return $front_page_path === $node_alias; + return $front_page_alias === $node_alias; } /** -- GitLab