#24741 closed defect (bug) (fixed)
"Quick Edit" button at "Comments" page doesn't work in slow connection
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.5.1 |
Component: | Comments | Keywords: | has-patch commit |
Focuses: | administration | Cc: |
Description (last modified by )
I found that "Quick Edit" button at "Comments" page does not correctly work when necessary JavaScript files are not yet fully loaded. I observe this problem in WordPress version 3.5.1.
I guess this problem happens when a user makes a clicks on “Quick Edit” button too soon before some external JavaScript for the feature get loaded. For this reason, It seems this bug would be more problematic when network connection is slow.
Here's the use case scenario by which you can reproduce the error:
- get log in WordPress site.
- click “Comments” button in left side menu in “Dashboard” page.
- click “Quick Edit” button. The error may occur at this moment -- even though you clicked, the input form may not show up, and my Firefox browser shows an uncaught exception:
Attachments (3)
Change History (17)
This ticket was mentioned in IRC in #wordpress-dev by aubreypwd. View the logs.
11 years ago
@
11 years ago
Tests for commentReply before using onclick since commentReply isn't defined until the footer
#3
@
11 years ago
- Keywords has-patch added
edit-comments.js
indeed is not loaded until the footer, so onclick="commentReply.open"
would not work beforehand because commentReply
is not yet defined. I've attached a patch that tests that commentsReply
is an object before it's accessed. Successfully keeps the error from posting, which could cause problems maybe in some situations.
#6
@
11 years ago
The proper thing to do here is to make this be unobtrusive JavaScript. Committing this will make me die a little inside.
#7
@
11 years ago
- Owner set to nacin
- Resolution set to fixed
- Status changed from new to closed
In 27747:
#8
follow-up:
↓ 10
@
11 years ago
@nacin So, do we want to ad id=
's to these and apply via JQuery? Would that be the best route? And where would to JS go in core to make this unobtrusive?
This ticket was mentioned in IRC in #wordpress-dev by aubreypwd. View the logs.
11 years ago
#10
in reply to:
↑ 8
@
11 years ago
Replying to aubreypwd:
You don't need HTML IDs there. So many different ways to make this particular code better :)
The least changes one would be to add data-wp-*
attributes and have one $( document ).on( 'click.comment-row-actions', function()...
to catch all clicks on these links.
For your better understanding of the buggy scenario,
I just added a video that shows an actual error execution.
http://core.trac.wordpress.org/attachment/ticket/24741/WordPress.wmv
Loading of "Comments" page starts at 00:15. At 00:17, I clicked "Quick Edit" button and the error message "ReferenceError: commentReply is not defined" appears in Firefox console.
Let me know if you have a probelm of reproducing the error. Thank you.