Core theme generator cannot be used because is not finding theme's included subtheme

Created on 15 June 2023, over 1 year ago

Problem/Motivation

In issue https://www.drupal.org/project/radix/issues/3365825 Use core's starterkit for subtheming Fixed We are trying to add subtheming in radix theme using core generator rather than using drush subtheming, but theme generator cannot be used directly because ExtensionDiscovery is not finding the subthemes included in theme so to make it work we must run this:

# placed in radix theme directory otherwise the starterkit theme is not visible
cp -r src/kits/radix_starterkit ../
# and then running from drupal webroot
php  core/scripts/drupal generate-theme --starterkit radix_starterkit  mytheme

This happens because generator is not going deep in theme directory.:
https://git.drupalcode.org/project/drupal/-/blob/10.0.x/core/lib/Drupal/...

Could it can deeper in themes to look for extensions in them?

Steps to reproduce

Require radix or other theme including subtheme and try to generate the subtheme with

php core/scripts/drupal generate-theme --starterkit radix_starterkit mytheme

How ExtensionDiscovery scans themes can be seen if you run:

use \Drupal\Core\Extension\ExtensionDiscovery;
$listing = new ExtensionDiscovery(\Drupal::root());
$themes = $listing
        ->scan('theme');
print_r($themes);

You will see how ExtensionDirectory will not list these included subthemes.

Feature request
Status

Active

Version

10.0

Component
Theme 

Last updated about 1 hour ago

Created by

🇪🇸Spain aleix

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024