You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem Statement:
Our website uses the context module to use multiple themes depending on various criteria (such as content type). When used in combination with the component_blocks + ui_patterns modules, we never see any component blocks in the toolbar, unless they're associated with the default theme. The reason for this is this block of code:
/** * Create a list of all directories to scan. * * This includes all module directories and directories of the default theme * and all of its possible base themes. * * @return array * An array containing directory paths keyed by their extension name. */protectedfunctiongetDirectories() {
$default_theme = $this->themeHandler->getDefault();
$base_themes = $this->themeHandler->getBaseThemes($this->themeHandler->listInfo(), $default_theme);
$theme_directories = $this->themeHandler->getThemeDirectories();
$directories = [];
if (isset($theme_directories[$default_theme])) {
$directories[$default_theme] = $theme_directories[$default_theme];
foreach ($base_themesas$name => $theme) {
$directories[$name] = $theme_directories[$name];
}
}
return$directories + $this->moduleHandler->getModuleDirectories();
}
It's explicitly only ever looking for the default theme, so it doesn't let sites with multiple themes to use patterns.
Proposed Solution
This is not the same issue as #304 but both could be solved the same way, per @vever001's suggestion: #304 (comment)
Oh also, FWIW we can't just look at the active theme instead of the default theme either. I tested swapping $this->themeHandler->getDefault(); with \Drupal::service('theme.manager')->getActiveTheme()->getName();, but when used with layout builder it seemed to be grabbing the admin theme, not the theme of the current page.
Problem Statement:
Our website uses the context module to use multiple themes depending on various criteria (such as content type). When used in combination with the component_blocks + ui_patterns modules, we never see any component blocks in the toolbar, unless they're associated with the default theme. The reason for this is this block of code:
It's explicitly only ever looking for the default theme, so it doesn't let sites with multiple themes to use patterns.
Proposed Solution
This is not the same issue as #304 but both could be solved the same way, per @vever001's suggestion: #304 (comment)
Since that's the way core does it, it makes the most sense to replicate that behavior.
It is also worth noting this would not get fixed by the PR in #305.
The text was updated successfully, but these errors were encountered: