Opened 8 years ago
Last modified 3 years ago
#38563 reviewing defect (bug)
Theme installed state does not persist after installation and refined search
Reported by: | ovann86 | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Themes | Keywords: | has-patch needs-refresh needs-testing |
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.
Proposed patch for 38563