WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#20885 closed defect (bug) (fixed)

JS console error with comment keyboard shortcuts

Reported by: tw2113 Owned by: 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 3 years ago.
20885.2.patch (1.0 KB) - added by SergeyBiryukov 3 years ago.
20885-3.patch (1.9 KB) - added by azaozz 3 years ago.
20885.4.patch (1.8 KB) - added by SergeyBiryukov 3 years ago.
Same as 20885-3.patch, with better formatting

Download all attachments as: .zip

Change History (21)

comment:1 @ocean903 years ago

Please define SCRIPT_DEBUG and check your console again.

comment:2 @tw21133 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

comment:3 @SergeyBiryukov3 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.

comment:4 @SergeyBiryukov3 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).

comment:5 @SergeyBiryukov3 years ago

FWIW, works in Firefox 3.6.25.

comment:6 @tw21133 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.

comment:7 follow-up: @SergeyBiryukov3 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.

@SergeyBiryukov3 years ago

comment:8 @SergeyBiryukov3 years ago

  • Keywords needs-testing added

comment:9 @ocean903 years ago

Related/duplicate: #19489

comment:10 in reply to: ↑ 7 @azaozz3 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.

@SergeyBiryukov3 years ago

comment:11 follow-up: @SergeyBiryukov3 years ago

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

@azaozz3 years ago

comment:12 in reply to: ↑ 11 @azaozz3 years ago

Replying to SergeyBiryukov:

Ah, you beat me to it :)

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

comment:13 @SergeyBiryukov3 years ago

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

comment:14 @azaozz3 years ago

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

Tested in all supported browsers, works.

comment:15 follow-up: @ryan3 years ago

20885.2.patch?

@SergeyBiryukov3 years ago

Same as 20885-3.patch, with better formatting

comment:16 in reply to: ↑ 15 @azaozz3 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.

comment:17 @ryan3 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.