Open WidgetsBurritos opened 3 years ago
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: https://github.com/nuvoleweb/ui_patterns/issues/304#issuecomment-687164731
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.