Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Follow up https://www.drupal.org/project/drupal/issues/474684#comment-13515433
@tedbow: I was reviewing another issue and found a @todo reference to this in \Drupal\Core\Extension\ThemeInstaller::uninstall()
// Base themes cannot be uninstalled if sub themes are installed, and if
// they are not uninstalled at the same time.
// @todo https://www.drupal.org/node/474684 and
// https://www.drupal.org/node/1297856 themes should leverage the module
// dependency system.
if (!empty($list[$key]->sub_themes)) {
foreach ($list[$key]->sub_themes as $sub_key => $sub_label) {
if (isset($list[$sub_key]) && !in_array($sub_key, $theme_list, TRUE)) {
throw new \InvalidArgumentException("The base theme $key cannot be uninstalled, because theme $sub_key depends on it.");
}
}
}
Proposed resolution
@tedbow: the other issue was marked as duplicate. Since modules can't depend on themes I don't [think] we need to do anything. But we should make a follow up to remove this todo or refactor to share logic with module installer.
([think] is added by @jungle)
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#2 | 3121024-2.patch | 840 bytes | jungle |
Comments
Comment #2
jungleRemoved @todo
Comment #3
jungleComment #4
bnjmnmYep, that removes the @todo that shouldn't be there!
Comment #5
catchCommitted 1cc6d23 and pushed to 9.0.x. Thanks!
Comment #7
jungleThanks @bnjmnm for reviewing and @catch for committing.
One more thing, I think this should be committed to 8.9.x as 474684 was committed to 8.9.x too. And the patch in #2 works on all 3 branches. A new patch is unnecessary.