-
Couldn't load subscription status.
- Fork 55
Open
Description
If we are on the admin theme, and we have pattern definitions inside another theme (e.g: your main theme), then the path in hook_theme() definitions are not correct.
This is because LibraryPattern::processCustomThemeHookProperty only takes into account modules.
protected function processCustomThemeHookProperty(PatternDefinition $definition) {
/** @var \Drupal\Core\Extension\Extension $module */
$return = [];
if (!$definition->hasCustomThemeHook() && $this->moduleHandler->moduleExists($definition->getProvider())) {
$module = $this->moduleHandler->getModule($definition->getProvider());
$return['path'] = $module->getPath() . '/templates';
if ($this->templateExists($definition->getBasePath(), $definition->getTemplate())) {
$return['path'] = str_replace($this->root, '', $definition->getBasePath());
}
}
return $return;
}
This breaks for example the preview when we are in the Views admin and other patterns usages when the active theme is not the one that contains the definitions.
I will create a PR shortly.
Metadata
Metadata
Assignees
Labels
No labels