Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#20885 closed defect (bug) (fixed)

JS console error with comment keyboard shortcuts

Reported by: tw2113's profile tw2113 Owned by: ryan's profile ryan
Milestone: 3.4 Priority: normal
Severity: normal Version:
Component: Comments Keywords: has-patch commit
Focuses: Cc:

Description

Keyboard shortcuts for comment moderation are throwing console errors and not doing intended results due to it.

The console error:

TypeError: e.all[o] is undefined

mydomain.com/wp-admin/load-scripts.php?c=1&load=admin-bar,hoverIntent,common,jquery-color,wp-ajax-response,wp-lists,quicktags,jquery-query,admin-comments,jquery-hotkeys,jquery-table-hotkeys,word-count,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-resizable,jquery-ui-draggable,jquery-ui-button,jquery-ui-position,jquery-ui-dialog,wpdialogs,wplink,wpdialogs-popup&ver=3.4-RC2-21026
Line 21

Attachments (4)

20885.patch (12.6 KB) - added by SergeyBiryukov 12 years ago.
20885.2.patch (1.0 KB) - added by SergeyBiryukov 12 years ago.
20885-3.patch (1.9 KB) - added by azaozz 12 years ago.
20885.4.patch (1.8 KB) - added by SergeyBiryukov 12 years ago.
Same as 20885-3.patch, with better formatting

Download all attachments as: .zip

Change History (21)

#1 @ocean90
12 years ago

Please define SCRIPT_DEBUG and check your console again.

#2 @tw2113
12 years ago

With Script Debug turned on. Sorry about that part.

TypeError: that.all[element] is undefined
http://mydomain.com/wp-includes/js/jquery/jquery.hotkeys.dev.js?ver=0.0.2m
Line 84

#3 @SergeyBiryukov
12 years ago

Hmm. Not sure what's going on, but I see the same error in all releases back to 2.7 when the shortcuts were introduced. Tested in Firefox 12 by pressing j/k on the Comments screen.

#4 @SergeyBiryukov
12 years ago

Works fine (including current trunk) in Chrome 19 and Opera 11.64.

Doesn't work in IE 8 (same error as in Firefox).

#5 @SergeyBiryukov
12 years ago

FWIW, works in Firefox 3.6.25.

#6 @tw2113
12 years ago

I'll add in that it wasn't working in Firefox 14 and didn't change for 15. I run their Aurora channel and it updated today. Still the same errors.

#7 follow-up: @SergeyBiryukov
12 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to Future Release

Updating jQuery Hotkeys plugin to 0.8+ (https://github.com/tzuryby/jquery.hotkeys) fixes the issue.

#8 @SergeyBiryukov
12 years ago

  • Keywords needs-testing added

#9 @ocean90
12 years ago

Related/duplicate: #19489

#10 in reply to: ↑ 7 @azaozz
12 years ago

Replying to SergeyBiryukov:

Updating jQuery Hotkeys plugin to 0.8+ (https://github.com/tzuryby/jquery.hotkeys) fixes the issue.

Yes, but also requires a lot of changes to table-hotkeys.dev.js as the plugin is completely different (for the better).

If we want this in 3.4 perhaps we can fix the old plugin, seems there is quite a bit of outdated code there but disabling some of the unnecessary things makes it work again.

#11 follow-up: @SergeyBiryukov
12 years ago

20885.2.patch seems to fix the issue in the old plugin.

@azaozz
12 years ago

#12 in reply to: ↑ 11 @azaozz
12 years ago

Replying to SergeyBiryukov:

Ah, you beat me to it :)

Yes, that was the problem, seems to work in all browsers now.

#13 @SergeyBiryukov
12 years ago

Some more testing without the patches: worked in Firefox 9, stopped working in Firefox 10.

#14 @azaozz
12 years ago

  • Keywords commit added; needs-testing removed
  • Milestone changed from Future Release to 3.4

Tested in all supported browsers, works.

#15 follow-up: @ryan
12 years ago

20885.2.patch?

@SergeyBiryukov
12 years ago

Same as 20885-3.patch, with better formatting

#16 in reply to: ↑ 15 @azaozz
12 years ago

Replying to ryan:

20885.2.patch?

Yes, 2.patch fixes the problem, 3.patch also removes some unneeded checks that are handled by jQuery now and 4.patch fixes the formatting. All three patches work with 4.patch being the best to go in.

#17 @ryan
12 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [21035]:

Fix comment hotkeys for FF and IE. Props azaozz, SergeyBiryukov. fixes #20885

Note: See TracTickets for help on using tickets.