From c0d58ff98789a97f6e8e4697ad026a176da9cc45 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 12 Dec 2022 15:08:05 -0800 Subject: [PATCH] Make Drupal 10 compatible --- kraken.info.yml | 5 ++--- kraken.theme | 13 +++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/kraken.info.yml b/kraken.info.yml index 6995ef1..dbdfda2 100755 --- a/kraken.info.yml +++ b/kraken.info.yml @@ -1,10 +1,9 @@ name: Kraken type: theme -core: 8.x -base theme: stable +base theme: stable9 description: 'Kraken is a Drupal base theme that provides integration with the UBC CLF (Common Look and Feel) for UBC-branded units. We recommend against using this theme for any customizations or modifications. If you require a customized UBC CLF theme, please consider the Drupal CLF theme' package: kraken -core_version_requirement: ^8 || ^9 +core_version_requirement: ^8 || ^9 || ^10 libraries: - kraken/global diff --git a/kraken.theme b/kraken.theme index 732dc3e..5910ba9 100755 --- a/kraken.theme +++ b/kraken.theme @@ -68,6 +68,7 @@ function kraken_page_attachments_alter(array &$page) */ function kraken_preprocess_html(&$variables) { + $theme_path = \Drupal::service('extension.list.theme'); // Add meta tags and links. $viewport = [ '#type' => 'html_tag', @@ -92,7 +93,7 @@ function kraken_preprocess_html(&$variables) '#tag' => 'meta', '#attributes' => [ 'name' => 'msapplication-config', - 'content' => '/' . drupal_get_path('theme', 'kraken') . '/img/favicons/browserconfig.xml', + 'content' => '/' . $theme_path->getPath('kraken') . '/img/favicons/browserconfig.xml', ], ]; @@ -110,7 +111,7 @@ function kraken_preprocess_html(&$variables) '#attributes' => [ 'rel' => 'apple-touch-icon', 'sizes' => '180x180', - 'href' => '/' . drupal_get_path('theme', 'kraken') . '/img/favicons/apple-touch-icon.png', + 'href' => '/' . $theme_path->getPath('kraken') . '/img/favicons/apple-touch-icon.png', ], ]; @@ -118,7 +119,7 @@ function kraken_preprocess_html(&$variables) '#tag' => 'link', '#attributes' => [ 'rel' => 'manifest', - 'href' => '/' . drupal_get_path('theme', 'kraken') . '/img/favicons/site.webmanifest', + 'href' => '/' . $theme_path->getPath('kraken') . '/img/favicons/site.webmanifest', ], ]; @@ -126,7 +127,7 @@ function kraken_preprocess_html(&$variables) '#tag' => 'link', '#attributes' => [ 'rel' => 'mask-icon', - 'href' => '/' . drupal_get_path('theme', 'kraken') . '/img/favicons/safari-pinned-tab.svg', + 'href' => '/' . $theme_path->getPath('kraken') . '/img/favicons/safari-pinned-tab.svg', 'color' => '#002145', ], ]; @@ -136,7 +137,7 @@ function kraken_preprocess_html(&$variables) '#attributes' => [ 'rel' => 'icon', 'sizes' => 'any', - 'href' => '/' . drupal_get_path('theme', 'kraken') . '/img/favicons/favicon.ico', + 'href' => '/' . $theme_path->getPath('kraken') . '/img/favicons/favicon.ico', ], ]; @@ -145,7 +146,7 @@ function kraken_preprocess_html(&$variables) '#attributes' => [ 'rel' => 'icon', 'type' => 'image/svg+xml', - 'href' => '/' . drupal_get_path('theme', 'kraken') . '/img/favicons/favicon.svg', + 'href' => '/' . $theme_path->getPath('kraken') . '/img/favicons/favicon.svg', ], ];