Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#15746 closed defect (bug) (fixed)

"g.getAttribute is not a function" error

Reported by: scribu Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version:
Component: Administration Keywords: needs-testing
Focuses: Cc:


Steps to reproduce:

  1. Go to wp-admin/edit-comments.php and set Comments per screen: 8
  2. Trash a comment

Attachments (3)

15746.diff (466 bytes) - added by greuben 11 years ago.
15746-2.diff (515 bytes) - added by greuben 11 years ago.
15746.2.diff (497 bytes) - added by greuben 11 years ago.
patch relative to trunk

Download all attachments as: .zip

Change History (11)

#1 @ocean90
11 years ago

Which browser? I can't reproduce it. g.getAttribute is only used in jquery.js: http://grab.by/7OcD

#2 @scribu
11 years ago

It only happens if you have SCRIPT_DEBUG = false.

Reproduced in both Firefox and Chrome. In Chrome's console, you can see the backtrace, which is very useful in this case.

#3 @ocean90
11 years ago


greuben: happens only when the difference between approved comments and comments per screen is 3. I was confirming that bug here with scribu, I had 11 comments and using chrome browser....

#4 @ocean90
11 years ago

With and without SCRIPT_DEBUG I get now:

Uncaught TypeError: Object #<a Text> has no method 'getAttribute

11 years ago

#5 @greuben
11 years ago

  • Keywords has-patch added

Sometimes json_decode outputs as TEXT, so forcing it to object resolves it.

#6 @greuben
11 years ago

  • Keywords needs-patch added; has-patch removed

Ignore my previous patch.

11 years ago

#7 @greuben
11 years ago

  • Keywords needs-testing added; needs-patch removed

the \n is creating an empty text node which is causing this error.

11 years ago

patch relative to trunk

#8 @scribu
11 years ago

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

(In [16836]) Fix strange JS error when trashing a comment. Props greuben. Fixes #15746

Note: See TracTickets for help on using tickets.