Opened 14 hours ago
Last modified 7 hours ago
#63737 new defect (bug)
Theme update fails, creates duplicate directory after incorrect plugin update attempt
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 6.8.2 |
Component: | Upgrade/Install | Keywords: | |
Focuses: | Cc: |
Description
When attempting to update an existing theme (e.g., my-theme) via ZIP upload using the WordPress admin installer, an issue arises if a prior, incorrect update attempt was made through the plugin installer.
Steps to reproduce:
- Have an existing theme installed (e.g., my-theme).
- Prepare a ZIP file of an updated version of my-theme.
- Navigate to Plugins > Add New > Upload Plugin.
- Attempt to upload the theme ZIP file.
- WordPress correctly displays the error: "The package could not be installed. No valid plugins were found. Plugin installation failed."
- Navigate to Appearance > Themes > Add New > Upload Theme.
- Attempt to upload the same theme ZIP file that was used in step 4.
- Expected behavior: WordPress should overwrite the existing wp-content/themes/my-theme directory with the contents of the uploaded ZIP file, effectively updating the theme.
- Actual behavior: Instead of overwriting, WordPress creates a new directory named wp-content/themes/my-theme-1 and installs the updated theme there. The original wp-content/themes/my-theme directory remains untouched.
- Subsequent attempts to update the theme through the theme installer will continue to create new directories, making it impossible to update the theme correctly.
This behavior suggests that the failed plugin installation attempt leaves a residual state or flag that incorrectly influences subsequent theme update attempts, preventing the proper overwrite of the existing theme directory. This can lead to a cluttered themes directory and a broken update mechanism for the affected theme.
I'm using WP 6.8.2, but this behavior affects previous versions, too.
Note: See
TracTickets for help on using
tickets.
The header of the my-theme theme is: