#32466 closed defect (bug) (fixed)
List table: hidden columns return unnecessary empty items
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | normal | Version: | 4.2 |
Component: | Administration | Keywords: | has-patch |
Focuses: | javascript | Cc: |
Description
While investigating on List Tables, noticed the hidden columns (see get_hidden_columns()
) returned, for example, this:
where the serialized array stored in the DB has 4 empty strings (going to break it in multiple lines for readability):
`a:8:{ i:0;s:6:"author"; i:1;s:10:"categories"; i:2;s:4:"tags"; i:3;s:8:"comments"; i:4;s:0:""; i:5;s:0:""; i:6;s:0:""; i:7;s:0:""; }`
Turns out the current jQuery selector targets also the table headers in the footer and they don't have an ID. Since we need just the table headers with an ID, and we can't predict if they will be the ones in the thead
or the ones in the tfoot
, the proposed patch changes the jQuery selector to target just the ones with an ID.
Stored value with the patch applied:
`a:4:{i:0;s:6:"author";i:1;s:10:"categories";i:2;s:4:"tags";i:3;s:8:"comments";}`
Attachments (2)
Change History (12)
#6
@
10 years ago
- Keywords commit removed
- Owner changed from afercia to wonderboymusic
There's another piece to this, wp_ajax_hidden_columns()
has to be rebooted to not explode on empty string, which will produce an array with one empty item.
Updated patch with coding standards.