From 87d6be5991e0f09cd78439ffac96591e1d27d2c7 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 15 Sep 2015 13:43:28 +0000 Subject: [PATCH] Comments: When setting the `colspan` value for inline edit/reply, make sure it's actually a table and the value is not empty. Props afercia. Fixes #33596. git-svn-id: https://develop.svn.wordpress.org/trunk@34179 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/edit-comments.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/js/edit-comments.js b/src/wp-admin/js/edit-comments.js index e915088bb2..e06f93a9d6 100644 --- a/src/wp-admin/js/edit-comments.js +++ b/src/wp-admin/js/edit-comments.js @@ -623,7 +623,8 @@ commentReply = { var editRow, rowData, act, replyButton, editHeight, t = this, c = $('#comment-' + comment_id), - h = c.height(); + h = c.height(), + colspanVal = 0; t.close(); t.cid = comment_id; @@ -633,8 +634,12 @@ commentReply = { action = action || 'replyto'; act = 'edit' == action ? 'edit' : 'replyto'; act = t.act = act + '-comment'; + colspanVal = $( 'th:visible, td:visible', c ).length; - $( 'td', editRow ).attr( 'colspan', $( 'th:visible, td:visible', c ).length ); + // Make sure it's actually a table and there's a `colspan` value to apply. + if ( editRow.hasClass( 'inline-edit-row' ) && 0 !== colspanVal ) { + $( 'td', editRow ).attr( 'colspan', colspanVal ); + } $('#action', editRow).val(act); $('#comment_post_ID', editRow).val(post_id);