[wp-trac] [WordPress Trac] #33943: Changeset 34095 and 34180 from recent 4.3.1 update breaks comment table layout

WordPress Trac noreply at wordpress.org
Mon Sep 21 09:08:54 UTC 2015


#33943: Changeset 34095 and 34180 from recent 4.3.1 update breaks comment table
layout
--------------------------+-----------------------------
 Reporter:  becki         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Comments      |    Version:  4.3
 Severity:  normal        |   Keywords:
  Focuses:  javascript    |
--------------------------+-----------------------------
 hello there,

 i'm using the latest wp 4.3.1 and discovered a bug with my wordpress
 setup. i'm using wordpress as some sort of documentation system and users
 can submit optional info when posting a comment.

 this optional info is appended to the comment and displayed as a table
 when viewing comments in the admin panel -> /wp-admin/edit-comments.php
 (see screenshot attachments).

 with the most recent update to 4.3.1 and changes to /wp-admin/js/edit-
 comments.js it breaks the layout of the comment table with my sort of
 special setup.

 the changesets affecting my setup:

 https://core.trac.wordpress.org/changeset/34095/branches/4.3
 https://core.trac.wordpress.org/changeset/34180/branches/4.3

 this line in edit-comments.js counts the <th> and <td>

 {{{
 colspanVal = $( 'th:visible, td:visible', c ).length;
 }}}

 and then adds it to the edit row


 {{{
                 if ( editRow.hasClass( 'inline-edit-row' ) && 0 !==
 colspanVal ) {
                         $( 'td', editRow ).attr( 'colspan', colspanVal );
                 }
 }}}

 in my case it counts all the <th> and <td> from the optional info table
 appended to the comment and then sets a colspan value of 24 to the
 #replyrow, which finally breaks the layout of the comment table, (see
 screenshot attachments)

 if there's no info table appended to the comment then all is working fine.

 for the moment being, to get things working again for my client, i changed
 the jquery selector to NOT count the <th> and <td> of my optional info
 table with a class of .timeSheetEntries


 {{{
 colspanVal = $( 'th:visible table:not(".timeSheetEntries"), td:visible
 table:not(".timeSheetEntries")', c ).length;
 }}}

 so, all is working fine again with my workaround but i'm not sure on how
 to properly solve this issue? as i don't want to do the change on each
 worpdress update!

 What would be the proper way to handle this issue? should i display my
 data appended to the comment in a non <table> way? can we update the
 jquery to not match the table appended to the comment?

 what would be the best way?

 thanks, greetings & all the best
 becki

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33943>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list