The tableselect element is awesome! But it doesn't print #title, #description etc.

CommentFileSizeAuthor
elements-theme_form_element.patch410 bytesJohn Morahan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
Status: Needs review » Postponed

The tableselect is a backport implementation of Drupal 7's core element. I'll backport any changes from there only.

Dave Reid’s picture

Component: Code » Table select
Dave Reid’s picture

Status: Postponed » Closed (won't fix)
Cyberwolf’s picture

Hi

I think not implementing this is a bad idea. The #title and #description elements are usually important information for the end user, and it's bad for usability if they aren't there.

The fix is very small though, in theme_tableselec(), replace the last line:

return theme('table', $header, $rows);

with this:

$table = theme('table', $header, $rows);

return theme('form_element', $element, $table);

Edit: didn't see the patch, sorry for my useless comment

This probably should be fixed for Drupal 7 as well. I'll check the issue tracker of the Drupal project to see if there are any issues similar to this one.

Cyberwolf’s picture

Status: Closed (won't fix) » Active

It looks to me like in Drupal 7 form element theming has changed quite a bit, the individual theme functions for field types (for example theme_textfield) are not calling theme('form_element', ...) anymore themselves. I guess this is called automatically afterward. I did not test this on a site, just my conclusion from a quick look at the code. It might be worth investigating this in detail.

Dave Reid’s picture

Status: Active » Closed (won't fix)

D7 doesn't call theme('form_element') on tableselects at all. I just double-checked. Therefore, this change would have to come as a backport from Drupal 7.