- Issue created by @luke.stewart
- 🇳🇿New Zealand luke.stewart
This looks to happen because:
In dxpr_theme_post_update_n1_migrate_colors we
// Load callbacks. require_once $theme_handler ->getTheme('dxpr_theme') ->getPath() . '/dxpr_theme_callbacks.inc';
Which gives us the function 'dxpr_theme_css_cache_build'
Then we loop over all themes and if it is dxpr_theme or a first generation child subtheme - i.e. this update doesn't work for multiple levels of subtheme.
We do stuff then call dxpr_theme_css_cache_build
In dxpr_theme_css_cache_build we
Use a hardcoded reference to the dxpr_theme to load all the files in features that are suffixed css.inc
foreach (\Drupal::service('file_system')->scanDirectory(\Drupal::service('extension.list.theme')->getPath('dxpr_theme') . '/features', '/css.inc/i') as $file)
This loop runs multiple times if we have a subtheme/s that match above.
We are using 'require_once $file->uri;' so we should only require this once. ????? SO why do we get a redeclared error!