Download & Extend

theme_table doesn't use thead with empty cells

Project:Drupal core
Version:7.x-dev
Component:theme system
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)
Issue tags:Needs tests

Issue Summary

When calling theme_table with an empty rows array but with an 'empty' text set, it will automatically create a row for that empty text. However, the header is already generated before that row is added and thus doesn't use thead because it assumes there is no tbody. The attached patch just reverses the order so that the header properly uses thead when there is an empty row.

AttachmentSizeStatusTest resultOperations
table_thead.patch861 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 17,908 pass(es).View details

Comments

#1

Status:needs review» needs work

Makes sense. But let's make sure it stays fixed by having a test.

#2

Status:needs work» needs review

Wrote a small test for this

AttachmentSizeStatusTest resultOperations
720202.patch1.87 KBIdlePASSED: [[SimpleTest]]: [MySQL] 18,749 pass(es).View details

#3

Status:needs review» reviewed & tested by the community

Thanks!

#4

Status:reviewed & tested by the community» fixed

Committed to CVS HEAD. Thanks.

#5

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here