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

CommentFileSizeAuthor
#2 3121024-2.patch840 bytesjungle

Comments

jungle created an issue. See original summary.

jungle’s picture

StatusFileSize
new840 bytes

Removed @todo

jungle’s picture

Status: Active » Needs review
bnjmnm’s picture

Status: Needs review » Reviewed & tested by the community

Yep, that removes the @todo that shouldn't be there!

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 1cc6d23 and pushed to 9.0.x. Thanks!

  • catch committed 1dccf5f on 9.0.x
    Issue #3121024 by jungle:  Remove todo in ThemeInstaller::uninstall() or...
jungle’s picture

Thanks @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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.