WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 8 months ago

#38563 reviewing defect (bug)

Theme installed state does not persist after installation and refined search

Reported by: ovann86 Owned by: swissspidy
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch needs-refresh needs-testing
Focuses: javascript, administration Cc:
PR Number:

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)

  1. In the WordPress Administration, go to Appearance -> Themes -> Add New
  2. Search for 'Twenty'
  3. Install theme 'Twenty Twelve' and wait for installation to complete. The 'Installed' flag will appear above the installed theme.
  4. Refine search results by changing search term to 'Twenty T'
  5. 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)

38563.patch (461 bytes) - added by ovann86 3 years ago.
Proposed patch for 38563

Download all attachments as: .zip

Change History (5)

@ovann86
3 years ago

Proposed patch for 38563

#1 @ovann86
3 years ago

  • Keywords has-patch added

#2 @ocean90
3 years ago

  • Focuses javascript added
  • Owner set to swissspidy
  • Status changed from new to reviewing
  • Version trunk deleted

#3 @swissspidy
3 years ago

  • Milestone changed from Awaiting Review to Future Release

#4 @desrosj
8 months ago

  • Keywords needs-refresh needs-testing added

@ovann86 Are you able to refresh your patch to apply cleanly to the current trunk?

Note: See TracTickets for help on using tickets.