- Issue created by @stado
- 🇫🇷France stado
1. Solution for the warning:
Replace this code in DXPR Builder Media module file:
function dxpr_builder_media_preprocess_views_view(array &$variables): void {
if ($variables['view']->id() === 'dxpr_builder_media') {
// Get the active theme.
$active_theme = \Drupal::theme()->getActiveTheme()->getName();// Get the base theme of active theme.
/* @phpstan-ignore-next-line */$base_theme = \Drupal::service('theme_handler')->listInfo()[$active_theme]->base_theme;// Check if the active theme or base theme is 'gin'.
if ($active_theme === 'gin' || $base_theme === 'gin') {
$variables['view_array']['#attached']['library'][] = 'dxpr_builder_media/gin_style';
}
else {
$variables['view_array']['#attached']['library'][] = 'dxpr_builder_media/claro_style';
}
$variables['view_array']['#attached']['library'][] = 'dxpr_builder_media/view';
}
}With this code:
function dxpr_builder_media_preprocess_views_view(array &$variables): void {
if ($variables['view']->id() === 'dxpr_builder_media') {
// Get the active theme.
$active_theme = \Drupal::theme()->getActiveTheme()->getName();// Get the base theme of active theme.
/* @phpstan-ignore-next-line */
$theme_handler = \Drupal::service('theme_handler');
$theme_info = $theme_handler->listInfo()[$active_theme] ?? null;
$base_theme = $theme_info && isset($theme_info->info['base theme']) ? $theme_info->info['base theme'] : null;// Check if the active theme or base theme is 'gin'.
if ($active_theme === 'gin' || $base_theme === 'gin') {
$variables['view_array']['#attached']['library'][] = 'dxpr_builder_media/gin_style';
}
else {
$variables['view_array']['#attached']['library'][] = 'dxpr_builder_media/claro_style';
}
$variables['view_array']['#attached']['library'][] = 'dxpr_builder_media/view';
}
}2. Solution for the error:
Install RAT:
composer require drupal/rat
drush crEnjoy
Automatically closed - issue fixed for 2 weeks with no activity.