Deprecated core themes cannot be disabled on the "Appearance" tab because they are hidden

Created on 19 December 2022, about 2 years ago
Updated 22 January 2024, 11 months ago

Problem/Motivation

After upgrading a website to version 9.5.0, the following warning appeared in the site's Status report:

Deprecated themes enabled
Deprecated themes found: Classy, Stable.

My site is using Olivero as its default theme and Claro as the administration theme. Neither depends on Classy or Stable. I am unable to find a means to disable these unused deprecated themes. They do not appear on the list of themes on the "Appearance" page, where one normally uninstall unused themes. Screenshot:

There is a documentation page about Deprecated and obsolete modules and themes โ†’ , but it just say that they are deprecated and suggests that one should use Starterkit theme generator instead. It doesn't tell one how to disable them.

The problem only affects legacy websites. A brand new install of Drupal 9.5.0 with Olivero and Claro installed does not get this warning.

I suspect that the reason this happens is that Bootstrap5 version 2.0.5 (which used Classy as its "base theme", which in turn used Stable) in the past was installed as the default theme. However, Bootstrap5 is no longer installed now.

Steps to reproduce

To reproduce, install Drupal 9.5.0 and set Bootstrap5 version 2.0.5 as the default theme. Then uninstall Bootstrap5 and revert to Olivero as its default theme. You shall now get the warning about these deprecated themes being enabled.

Proposed resolution

Determine if there is a dependency on a hidden theme

drush theme-uninstall classy
drush theme-uninstall stable

Workarounds

Removehidden: true from code>core/themes/classy/classy.info.yml and core/themes/stable/stable.info.yml
uninstall the themes
Add the line back to the files.

If you are using the config exporter, edit your config/core.extension.yml file and remove the "classy" and "stable" elements under "theme"

Remaining tasks

๐Ÿ› Bug report
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Themeย  โ†’

Last updated about 1 hour ago

Created by

๐Ÿ‡ณ๐Ÿ‡ดNorway gisle Norway

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States trolin

    @Spokje, I just realized that I never acknowledged your comment #13. No offense taken, but yes, I did clear caches with no effect. I also tried installing Bootstrap5, then removing it, but Classy and Stable still have no uninstall options.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada noah

    @trolin: I had the same issue, and discovered when I tried to uninstall via Drush that one of my installed themes has Stable as its base_themeโ€”maybe that's why you don't see the uninstall option after unhiding?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States trolin

    @noah, you win the prize. I'm using theme danland which depends on classy which depends on stable. Thanks for the tip.

    Unlike D7, D9 seems to have a dearth of attractive themes ready for use. I hope that situation improves. I'll keep looking.

  • workaround #6 worked for me.

    I also didn't see an uninstall button on Stable noted in #11. Once i clicked uninstall on Classy, the Stable panel shifted and now there was an uninstall button there.

    Another way to achieve this, if you are using the config exporter, is to edit your config/core.extension.yml file and remove the "classy" and "stable" elements under "theme"

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States astringer

    Just reiterating #6 worked for me, if you simply need to get this done now.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States boinkster

    Confirming that #24 worked for me - do a 'drush cim' after the edit.

  • ๐Ÿ‡ช๐Ÿ‡ธSpain disparil

    In my case I cannot uninstall Classy and Stable, because my custom theme (News+ Lite) is based on Classy .

    Time to update my custom theme to a new Drupal9 base theme.

  • Status changed to Needs review over 1 year ago
  • last update over 1 year ago
    29,293 pass, 1 fail
  • last update over 1 year ago
    Custom Commands Failed
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand danielveza Brisbane, AU

    Updated the patch for this and added a test. Happy for opinions on if this is the right approach & the wording of the status message.

  • last update over 1 year ago
    29,354 pass, 2 fail
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand danielveza Brisbane, AU

    Fixing CCF from my earlier patch. Tests only patch in #28 is unchanged.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bcobin

    I'm on 9.5.10 and prepping to upgrade to Drupal 10 - I see no uninstall option as shown in #12. I could drush pm-uninstall, I suppose, but I'm using a subtheme of Bootstrap5 2.0.9. So if the following from #18 holds true for 2.0.9...

    You need to uninstall Bootstrap5 version 2.0.5 if you want to be able to uninstall Classy and Stable. The reason for this is that Bootstrap5 2.0.5 is set up with Classy as a base theme, and it in turn depends on Stable.

    I could end up completely borking the site. Any ideas? Suggestions greatly appreciated!

  • ๐Ÿ‡ณ๐Ÿ‡ดNorway gisle Norway

    To prepare for Drupal 10, upgrade from Bootstrap5 version 2.0.5 to version 3.0.9. Then the uninstall link should appear.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bcobin

    Thanks for the quick response!

    I installed Bootstrap5 3.0.9 and it seemed to work initially - cleared caches and crashed.

    Reading watchdog via Drush I got the following:

    Drupal\Core\Theme\MissingThemeDependencyException:
    Base theme stable9 has not been installed.
    in Drupal\Core\Theme\ThemeInitialization->getActiveThemeByName() (line 115 of /[site]

    Saw this post:

    https://designkojo.com/base-theme-stable9-has-not-been-installed

    Enabled stable9 using Drush:

    drush theme-enable stable9

    Site came back up and seems to be working, but I get a DB upgrade warning.

    Trying to update DB results in the following:

    [site]# drush updb
     ------------ ------------------------- ------------- ----------------------- 
      Module       Update ID                 Type          Description            
     ------------ ------------------------- ------------- ----------------------- 
      bootstrap5   install_stable9           post-update   Enable new theme:      
                                                           stable9.               
      bootstrap5   uninstall_stable_classy   post-update   Uninstall old themes:  
                                                           stable and classy.     
     ------------ ------------------------- ------------- ----------------------- 
    
    
     Do you wish to run the specified pending updates? (yes/no) [yes]:
     > yes
    
    >  [warning] Post update function bootstrap5_post_update_install_stable9 not found in file bootstrap5.post_update.php
    >  [error]  Update failed: bootstrap5_post_update_install_stable9 
     [error]  Update aborted by: bootstrap5_post_update_install_stable9 
     [error]  Finished performing updates. 
    

    At least the site seems to be working - any ideas here? Jeez...

    Thanks for your help!

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bcobin

    Update: Commenting out hidden: true in stable9.info.yml eliminates the DB error - let's see if I can make the transition to Drupal 10 and get rid of the deprecated themes there.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bwoods

    Patch #30 works for me, thank you!

  • As has been mentioned above, if a theme depends on Classy or Stable, then the uninstall for those will not appear, by design.

    To find out if you have an unexpected dependency, run the drush uninstall command:

    drush theme-uninstall classy
    
    drush theme-uninstall stable

    For me, those told me I had a dependency in my main site theme that needed to be looked at.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim

    The workaround needs to be detailed on this CR https://www.drupal.org/node/3305674 โ†’ as otherwise people upgrading from 9 to 10 with Classy or Stable installed can't remove them.

  • ๐Ÿ‡ท๐Ÿ‡บRussia urix

    To find out if you have an unexpected dependency, run the drush uninstall command:

    drush theme-uninstall classy

    drush theme-uninstall stable

    Thanks, worked for me.
    It happens that SimpleBlog theme is dependent on Classy theme, which is strange - because SimpleBlog is compatible with D10.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    I summarized the workarounds in the Issue Summary

Production build 0.71.5 2024