Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#39246 closed defect (bug) (fixed)

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

Reported by: Hristo Sg Owned by: obenland
Priority: normal Milestone: 4.7.1
Component: Themes Version: 4.6
Severity: normal Keywords:
Cc: Focuses: javascript

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
10 years ago

  • Milestone Awaiting Review → 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 10 years ago by dd32 (previous) (diff)

#2 @obenland
10 years ago

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

#3 in reply to: ↑ 1 @obenland
10 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
10 years ago

  • Resolution → fixed
  • Status accepted → 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
10 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
10 years ago

  • Version trunk → 4.6

#7 @Hristo Sg
10 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
10 years ago

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

Note: See TracTickets for help on using tickets.