Opened 9 years ago
Last modified 5 weeks ago
#38563 reviewing defect (bug)
Theme installed state does not persist after installation and refined search
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Themes | Keywords: | has-patch needs-refresh close |
| Focuses: | javascript, administration | Cc: |
Description
After installing a theme an 'Installed' flag is displayed above the theme.
If you refine the search results, and the same theme is in the results the theme does not display the 'Installed' flag.
Steps to reproduce:
(Exact steps assumes the WordPress installation does not have the theme Twenty Twelve installed)
- In the WordPress Administration, go to Appearance -> Themes -> Add New
- Search for 'Twenty'
- Install theme 'Twenty Twelve' and wait for installation to complete. The 'Installed' flag will appear above the installed theme.
- Refine search results by changing search term to 'Twenty T'
- The theme 'Twenty Twelve' will appear in the search results but will not have the 'Installed' flag.
If you attempt to install the theme again you receive an error message stating 'Installation failed: Destination folder already exists.'
The specifics ...
Installed themes are stored in a JavaScript array - _wpThemeSettings.installedThemes
The array is being created when the page loads and needs to be updated when a theme is installed so that new search results (which use Ajax and do not reload the page) have the complete list of installed themes.
The solution ...
Once the installed theme is successfully installed, push the theme slug into the array.
e.g.
_wpThemeSettings.installedThemes.push( response.slug );
Attached patch with how I would see this being done.
Attachments (1)
Change History (7)
#2
@
9 years ago
- Focuses javascript added
- Owner set to swissspidy
- Status changed from new to reviewing
- Version trunk deleted
#4
@
7 years ago
- Keywords needs-refresh needs-testing added
@ovann86 Are you able to refresh your patch to apply cleanly to the current trunk?
#6
@
5 weeks ago
- Keywords close added; needs-testing removed
Tested again on current trunk (7.0-alpha) and latest WordPress.
I’m no longer able to reproduce this issue. After installing a theme and refining the search results, the “Installed” label correctly persists and the theme is not offered for installation again.
It appears this behavior has already been fixed in core during previous updates.
Since the issue is no longer reproducible:
- removing
needs-testing - marking for
close

Proposed patch for 38563