Problem/Motivation

Theme uninstall does not show the confirmation page to show what are the configurations will be deleted or updated.

Steps to reproduce

  1. Install standard profile
  2. Go to /admin/appearance
  3. Set Claro as the default theme
  4. Uninstall Olivero

Proposed resolution

We have confirmation page for module uninstall. It will show the what are configurations will be update or deleted after uninstall. Same we need to implement the confirmation page for theme uninstall.

Remaining tasks

User interface changes

Uninstalling a theme shows a confirmation page listing the configurations that will be updated or deleted.

No before since there is no form.

New Theme uninstall form:

image

image

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3096170

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

iyyappan.govind created an issue. See original summary.

iyyappan.govind’s picture

Issue summary: View changes
cilefen’s picture

Issue tags: +Usability

Version: 8.7.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Branches prior to 8.8.x are not supported, and Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mstrelan’s picture

Issue summary: View changes

Updated the IS with issue template and added steps to reproduce.

mstrelan’s picture

We already have \Drupal\Core\Config\Entity\ConfigDependencyDeleteFormTrait::addDependencyListsToForm. We need to add the confirm form step as per \Drupal\system\Form\ModulesUninstallForm::submitForm and \Drupal\system\Form\ModulesUninstallConfirmForm::buildForm.

mstrelan’s picture

Status: Active » Needs work
Issue tags: +Needs tests

Added a first pass, seems to work from rudimentary testing. Needs test coverage.

longwave’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests

Came here via #3550019: Add ThemeUninstallValidatorInterface similar to ModuleUninstallValidatorInterface which appears to be requesting the same thing.

Cleaned up the form a bit and added some tests.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

nicxvan’s picture

Component: system.module » extension system

This feels like the extension api even if it's in the system module.

I'll try to review this.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new1.62 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

longwave’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Appears to have a phpstan failures

 ------ ----------------------------------------------------------------------- 
  Line   core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php                
 ------ ----------------------------------------------------------------------- 
         Ignored error pattern #^Method                                         
         Drupal\\Core\\Entity\\ContentEntityDeleteForm\:\:addDependencyListsTo  
         Form\(\) has no return type specified\.$# (missingType.return) in      
         path /builds/core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php   
         was not matched in reported errors.                                    
 ------ ----------------------------------------------------------------------- 
 ------ ----------------------------------------------------------------------- 
  Line   core/lib/Drupal/Core/Entity/EntityDeleteForm.php                       
 ------ ----------------------------------------------------------------------- 
         Ignored error pattern #^Method                                         
         Drupal\\Core\\Entity\\EntityDeleteForm\:\:addDependencyListsToForm\(\  
         ) has no return type specified\.$# (missingType.return) in path        
         /builds/core/lib/Drupal/Core/Entity/EntityDeleteForm.php was not       
         matched in reported errors.                                            
 ------ ----------------------------------------------------------------------- 
 ------ ----------------------------------------------------------------------- 
  Line   core/modules/system/src/Form/ModulesUninstallConfirmForm.php           
 ------ ----------------------------------------------------------------------- 
         Ignored error pattern #^Method                                         
         Drupal\\system\\Form\\ModulesUninstallConfirmForm\:\:addDependencyLis  
         tsToForm\(\) has no return type specified\.$# (missingType.return) in  
         path                                                                   
         /builds/core/modules/system/src/Form/ModulesUninstallConfirmForm.php   
         was not matched in reported errors.                                    

penyaskito’s picture

longwave’s picture

Status: Needs work » Needs review
nicxvan’s picture

Status: Needs review » Needs work

Overall the direction looks great, I took a look through the code and it makes sense.

There are some relevant test failures though.

longwave’s picture

Status: Needs work » Needs review
nicxvan’s picture

Status: Needs review » Reviewed & tested by the community

I think this is ready!

I think a parameter is fine, if we do want to change that to a path part we can do that in a follow up.

I think this feature is long, long overdue, I've accidentally uninstalled themes before!

I pulled this down and manually tested each case, a missing theme, no theme parameter, a base theme of an active theme, the current default, the current admin.

I wasn't sure at first why we needed all of the guards, since the uninstall link does not show up on themes you cannot uninstall,, but you can change the parameter, so it makes sense to guard against it.

I also looked at the module uninstall confirmation and this is consistent with that form.

godotislate’s picture

Only took a quick look, and it looks like this is largely parallel to the module uninstall confirmation form, but do we need a usability review for this? Maybe at least screenshots for the changes?

sivaji_ganesh_jojodae made their first commit to this issue’s fork.

catch’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs screenshots

Yes screenshots would be good, they'd be needed for a usability review anyway (but I think if it's consistent with module uninstall it'd be fine to go ahead without one here - we can always tackle them at the same time).

sivaji_ganesh_jojodae’s picture

Attached are screenshots of the Theme and Module uninstall confirmation pages.

image

image

image

image

nicxvan’s picture

I'll post in the channel!

nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
benjifisher’s picture

We discussed this issue at #3580386: Drupal Usability Meeting 2026-03-27. That issue will have a link to a recording of the meeting.

The attendees at the usability meeting were benjifisher, nicxvan, rkoller, simohell, the_g_bomb, and worldlinemine. I am giving them credit on this issue.

If you want more feedback from the usability team, a good way to reach out is in the #ux channel in Slack.

nicxvan’s picture

Status: Needs review » Needs work

Some notes and recommendations from the meeting, thank you everyone for your feedback!

We should update the page title getQuestion to Uninstall <theme name> Theme

We should update the warning text to:
The <theme name> theme will be completely uninstalled from your site, and all data from this theme will be lost!

We need to create two follow ups:
1. For the module uninstall form to update the page title depending on if one or multiple modules are being uninstalled:
Uninstall Module
Uninstall Modules

A follow up for the SDC issue discussed in #3550019: Add ThemeUninstallValidatorInterface similar to ModuleUninstallValidatorInterface

sivaji_ganesh_jojodae’s picture

Assigned: Unassigned » sivaji_ganesh_jojodae

Based on #32 and #33 updating tag.

Working on changing page title and warning text.

sivaji_ganesh_jojodae’s picture

Assigned: sivaji_ganesh_jojodae » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs usability review
StatusFileSize
new318.56 KB

I've updated the page title and warning text. Updated Test to match the same. Attached is the screenshot of the updated confirmation page.

nicxvan’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

I think this is ready!

I updated the screenshots in the Issue Summary based on the new one you took.
I reviewed the new commits.

This is a UI change does it need a CR?

Edit: Asked in slack and both @godotislate and @smustgrave suggested we should, so I created one.

nicxvan’s picture

Took a pass at credit too.

sivaji_ganesh_jojodae’s picture

@nicxvan, I’ve added a comment on the MR. To reiterate here, the buildForm() method is currently performing certain checks that would be more appropriately handled in the form validation layer.

penyaskito’s picture

@sivaji_ganesh_jojodae That's a confirmation form. There's no benefit to delay those checks if there's nothing you can confirm, so better redirect early. The MR is good as is.

godotislate’s picture

Status: Reviewed & tested by the community » Needs work

Nice work, everyone! This is close, just a couple comments on the MR.

sivaji_ganesh_jojodae’s picture

Status: Needs work » Needs review

I've addressed the comments on the MR.

nicxvan’s picture

I don't think we want to change away from query parameters, I'm not sure why map query parameter did not work.

godotislate’s picture

MapQueryParameter worked when I tried it locally. Maybe adding the use statement was missed?

sivaji_ganesh_jojodae’s picture

Thanks for the quick feedback on this. Yes, it was the missing use statement. There was a comment suggesting to use menu parameters. Anyway it is reverted to query parameters now and test is passing.

nicxvan’s picture

Status: Needs review » Reviewed & tested by the community

Looks good now! Thanks!

  • godotislate committed 392da0f5 on main
    feat: #3096170 Add Confirmation Page for theme uninstall
    
    By: mstrelan...

  • godotislate committed 7ef17907 on 11.x
    feat: #3096170 Add Confirmation Page for theme uninstall
    
    By: mstrelan...
godotislate’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 392da0f to main and 7ef1790 to 11.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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