Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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:
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:
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.)
Comment | File | Size | Author |
---|---|---|---|
#1 | form-tableselect-attributes-658032-1.patch | 768 bytes | cburschka |
Comments
Comment #1
cburschkaHere is my patch:
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedComment #3
webchickCommitted to HEAD. Thanks!