Opened 9 years ago
Last modified 2 weeks ago
#41341 new defect (bug)
Theme update notification appearing multiple times
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | normal | Version: | 4.9 |
| Component: | Themes | Keywords: | needs-patch shiny-updates |
| Focuses: | javascript, administration | Cc: |
Description
So I went to my dashboard and there were 5-6 themes which were out of date. So I clicked on Update on all, and opened the model of one of the themes (see the picture if you're confused). And as the themes were getting updated, the update alert started to appear on the opened theme for all the themes.
Looks like a bug to me.
Attachments (1)
Change History (12)
#1
@
9 years ago
- Keywords needs-patch shiny-updates added
- Milestone changed from Awaiting Review to Future Release
#9
@
2 weeks ago
Note: This issue affects every WordPress including 6.9.x, not only Version 4.9 as stated in issue details. It is and will be reported again and again, also because this 9 years old issue has wrong Version tag.
Took a look at some code.
wp.updates.updateThemeSuccess() in wp-admin/js/updates.js at about line 1600 tries to figure out the selector of target element for the update message.
It uses $notice = $( '.theme-info .notice' ) and obviously gets the element(s) in currently shown context, no matter if or which theme details currently are shown.
The actually updated theme slug would be available in response.slug but the DOM of theme details appears to not have the slug anywhere - or maybe I missed it.
So the suggested fix would be:
- add theme slug to DOM of each theme details
- use
response.slugto find target element for the update message - make sure only one
.theme-info .noticeis in theme details or use more specific selector to avoid showing message multiple times
#43596 was marked as a duplicate.