Download & Extend

theme_tableselect does not pass on #attributes key.

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

Issue Summary

The 'tableselect' form element type ostensibly accepts an #attributes property (like almost every other element type).

However, when generating the table in theme_tableselect, this property is not passed on:

<?php
 
return theme('table', array('header' => $header, 'rows' => $rows, 'empty' => $element['#empty']);
?>

In order to add the attributes onto the table, this line would have to be:

<?php
 
return theme('table', array('header' => $header, 'rows' => $rows, 'empty' => $element['#empty'], 'attributes' => $element['#attributes']));
?>

(Fixing this will incidentally make it possible to combine tabledrag and tableselect on the same table, which is pretty awesome.)

Comments

#1

Status:active» needs review

Here is my patch:

AttachmentSizeStatusTest resultOperations
form-tableselect-attributes-658032-1.patch768 bytesIdlePassed on all environments.View details

#2

Status:needs review» reviewed & tested by the community

#3

Status:reviewed & tested by the community» fixed

Committed to HEAD. Thanks!

#4

Status:fixed» closed (fixed)

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