Make WordPress Core

Opened 9 years ago

Last modified 2 weeks ago

#41341 new defect (bug)

Theme update notification appearing multiple times

Reported by: hardeepasrani's profile hardeepasrani 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)

screenshot-localhost 8888-2017-07-17-11-46-29.png (269.3 KB) - added by hardeepasrani 9 years ago.

Download all attachments as: .zip

Change History (12)

#1 @swissspidy
9 years ago

  • Keywords needs-patch shiny-updates added
  • Milestone changed from Awaiting Review to Future Release

#2 @swissspidy
8 years ago

#43596 was marked as a duplicate.

#3 @swissspidy
8 years ago

#43603 was marked as a duplicate.

#4 @SergeyBiryukov
5 years ago

#49771 was marked as a duplicate.

#5 @SergeyBiryukov
5 years ago

#52304 was marked as a duplicate.

#7 @poena
2 weeks ago

#64614 was marked as a duplicate.

#8 follow-up: @poena
2 weeks ago

#59538 was marked as a duplicate.

#9 @Ov3rfly
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.slug to find target element for the update message
  • make sure only one .theme-info .notice is in theme details or use more specific selector to avoid showing message multiple times

#10 @Ov3rfly
2 weeks ago

#43295 was marked as a duplicate.

#11 in reply to: ↑ 8 @Ov3rfly
2 weeks ago

#59538 was marked as a duplicate.

Note: This issue proposes some code for finding the correct element using the theme slug.

Note: See TracTickets for help on using tickets.