Make WordPress Core

Opened 4 weeks ago

Closed 3 weeks ago

#64614 closed defect (bug) (duplicate)

Theme updated message shown in wrong context

Reported by: ov3rfly's profile Ov3rfly Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Themes Keywords:
Focuses: Cc:

Description

When updating a theme and switching to other theme details during update, the updated message is shown in context of current visible other theme details after update in background is finished.

Attachments (3)

theme update notice.png (138.1 KB) - added by Ov3rfly 4 weeks ago.
theme update notice.mp4 (151.3 KB) - added by Ov3rfly 4 weeks ago.
updated.mp4 (490.8 KB) - added by Presskopp 4 weeks ago.

Download all attachments as: .zip

Change History (7)

#1 @Presskopp
4 weeks ago

As you can see in the screenshots, the update message appears twice. I think it's best to remove these messages completely when you leave the screen of the triggering plugin.

@Presskopp
4 weeks ago

#2 @Presskopp
4 weeks ago

it can even appear 3 times, see video

#3 @Ov3rfly
4 weeks ago

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

#4 @poena
3 weeks ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #41341.

Hi
This is a duplicate of https://core.trac.wordpress.org/ticket/41341 so I am closing this ticket.

Note: See TracTickets for help on using tickets.