From 6d30378234381bcfbf36c5c2ad1b92363ba99803 Mon Sep 17 00:00:00 2001 From: Reece Marsland Date: Tue, 3 Dec 2019 11:24:57 +0000 Subject: [PATCH] Load extensions from active theme not the default theme. --- src/TwigExtension/ExtensionLoader.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/TwigExtension/ExtensionLoader.php b/src/TwigExtension/ExtensionLoader.php index dfc3ef3..88aadd8 100644 --- a/src/TwigExtension/ExtensionLoader.php +++ b/src/TwigExtension/ExtensionLoader.php @@ -44,8 +44,7 @@ static public function get($type) { * The type to load all plugins for. */ static protected function loadAll($type) { - $theme = \Drupal::config('system.theme')->get('default'); - $themeLocation = drupal_get_path('theme', $theme); + $themeLocation = \Drupal::service('theme.manager')->getActiveTheme()->getPath(); $themePath = DRUPAL_ROOT . '/' . $themeLocation . '/'; $extensionPaths = glob($themePath . '*/_twig-components/');