[wp-trac] [WordPress Trac] #36742: Comments List Table: Comment date doesn't get linked on status change via Ajax

WordPress Trac noreply at wordpress.org
Wed Jul 13 01:57:05 UTC 2016


#36742: Comments List Table: Comment date doesn't get linked on status change via
Ajax
--------------------------+--------------------------
 Reporter:  ocean90       |       Owner:  rachelbaker
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  4.6
Component:  Comments      |     Version:  4.5
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+--------------------------

Comment (by rachelbaker):

 While testing a patch for #35501, I found I kept getting the following
 error in my console log:
 > wp-lists.js?ver=4.6-beta2-37993-src:310 Uncaught TypeError: Cannot read
 property '0' of undefined

 which was happening because line 300 of wp-lists.js has this conditional:
 {{{#!js
 if ( 'undefined' !== typeof res.responses[0].supplemental.comment_link ) {
 }}}

 where somehow I was able to trigger a condition where `res = true`.

 We should, at least, check that `res.responses` isn't `'undefined'` in the
 same conditional.

 Something like this:

 {{{#!js
 if ( 'undefined' !== typeof res.responses && 'undefined' !== typeof
 res.responses[0].supplemental.comment_link ) {
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36742#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list