Skip to content
Snippets Groups Projects

ISTWCMS-5176: Updating homepage check function.

Merged Igor Biki requested to merge feature/ISTWCMS-5176-ibiki-uwservice into 1.0.x
1 file
+ 2
1
Compare changes
  • Side-by-side
  • Inline
+ 2
1
@@ -503,8 +503,9 @@ class UWService implements UWServiceInterface {
@@ -503,8 +503,9 @@ class UWService implements UWServiceInterface {
*/
*/
public static function nodeIsHomePage(int $nid): bool {
public static function nodeIsHomePage(int $nid): bool {
$front_page_path = \Drupal::configFactory()->get('system.site')->get('page.front');
$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);
$node_alias = \Drupal::service('path_alias.manager')->getAliasByPath('/node/' . $nid);
return $front_page_path === $node_alias;
return $front_page_alias === $node_alias;
}
}
/**
/**
Loading