Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#39246 closed defect (bug) (fixed)

Theme deletion has a JS error that prevents multiple themes from being deleted.

Reported by: hristo-sg's profile Hristo Sg Owned by: obenland's profile obenland
Milestone: 4.7.1 Priority: normal
Severity: normal Version: 4.6
Component: Themes Keywords:
Focuses: javascript Cc:

Description (last modified by obenland)

In order to recreate the problem:

  • install multiple themes
  • delete a theme and close the window
  • try deleting a second one - it fails

on the first deletion, I see a JS error in the console:
Error: Syntax error, unrecognized expression: [data-slug="twentyfifteen"

In the wp-admin/js/theme.js there is a line:

$( '[data-slug="' + response.slug + '"' ).css( { backgroundColor:'#faafaa' } ).fadeOut( 350, function() {

in which I believe the shortcode is not closed and should be

$( '[data-slug="' + response.slug + '"]' ).css( { backgroundColor:'#faafaa' } ).fadeOut( 350, function() {

I was testing on Safari Version 10.0.1 (12602.2.14.0.7)

Change History (8)

#1 follow-up: @dd32
8 years ago

  • Milestone changed from Awaiting Review to 4.7.1

Shifting to 4.7.1, confirmed that the bracket is missing.

I see no reason not to fix it here, although curious how it was missed - does the post-fadeout callback function correctly after this is fixed?

This was introduced with [37714] so I'm going to call upon @obenland to test.

(Note: A patch for a single character isn't needed, unless other changes are also needed here, if you test, feel free to skip the patch and just comment with your findings)

Last edited 8 years ago by dd32 (previous) (diff)

#2 @obenland
8 years ago

  • Description modified (diff)
  • Focuses javascript added
  • Owner set to obenland
  • Status changed from new to accepted

#3 in reply to: ↑ 1 @obenland
8 years ago

Replying to dd32:

curious how it was missed - does the post-fadeout callback function correctly after this is fixed?

It works in both Chrome and Firefox, I assume no one then tested it in Safari

#4 @obenland
8 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 39586:

Themes: Add missing square bracket in jQuery selector.

Fixes a bug in Safari where the UI wasn't updated after deleting a theme due to
the incomplete selector.

Props Hristo Sg.
Fixes #39246.

#5 @obenland
8 years ago

In 39587:

Themes: Add missing square bracket in jQuery selector.

Fixes a bug in Safari where the UI wasn't updated after deleting a theme due to
the incomplete selector.

Props Hristo Sg.
Merges [39586] to the 4.7 branch.
Fixes #39246.

#6 @swissspidy
8 years ago

  • Version changed from trunk to 4.6

#7 @Hristo Sg
8 years ago

I have tested it locally and it works without errors in Safari now, just make sure you update the theme.min.js if it's not automatically generated which I doubt though :)

#8 @swissspidy
8 years ago

The minified files are updated during the build process using Grunt.

Note: See TracTickets for help on using tickets.