Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#15746 closed defect (bug) (fixed)

"g.getAttribute is not a function" error

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

Description

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 14 years ago.
15746-2.diff (515 bytes) - added by greuben 14 years ago.
15746.2.diff (497 bytes) - added by greuben 14 years ago.
patch relative to trunk

Download all attachments as: .zip

Change History (11)

#1 @ocean90
14 years ago

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

#2 @scribu
14 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
14 years ago

IRC:

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

With and without SCRIPT_DEBUG I get now:

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

@greuben
14 years ago

#5 @greuben
14 years ago

  • Keywords has-patch added

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

#6 @greuben
14 years ago

  • Keywords needs-patch added; has-patch removed

Ignore my previous patch.

@greuben
14 years ago

#7 @greuben
14 years ago

  • Keywords needs-testing added; needs-patch removed

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

@greuben
14 years ago

patch relative to trunk

#8 @scribu
14 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.