WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 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:

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

Download all attachments as: .zip

Change History (11)

comment:1 ocean903 years ago

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

comment:2 scribu3 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.

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

comment:4 ocean903 years ago

With and without SCRIPT_DEBUG I get now:

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

greuben3 years ago

comment:5 greuben3 years ago

  • Keywords has-patch added

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

comment:6 greuben3 years ago

  • Keywords needs-patch added; has-patch removed

Ignore my previous patch.

greuben3 years ago

comment:7 greuben3 years ago

  • Keywords needs-testing added; needs-patch removed

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

greuben3 years ago

patch relative to trunk

comment:8 scribu3 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.