Closed (duplicate)
Project:
Drupal core
Version:
6.x-dev
Component:
theme system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
15 Feb 2010 at 21:41 UTC
Updated:
28 Jun 2010 at 22:42 UTC
Jump to comment: Most recent
Comments
Comment #1
Anonymous (not verified) commentedI am moving the report to the correct queue.
Comment #2
jhodgdonWhich documentation are you reading/following?
Comment #3
jhodgdonSorry, wrong status change.
Comment #4
Anonymous (not verified) commentedI guess he is referring to http://api.drupal.org/api/function/theme_table/6, or to any
tablesort_*()function that is called bytheme_table().Comment #5
jhodgdonI would like more explanation of what the reporter really thinks is wrong, and whether the reporter thinks it is a documentation error or an error in the function logic. It's not clear to me from the issue report, and not being an expert on the sort argument to table theming, I cannot say for sure.
Also, it looks like the table sorting and table theming is fairly similar in Drupal 7 to what it is in Drupal 6, so it should probably start there.
Comment #6
wbossons commentedThe documentation states that the field argument can be used to specify which column to sort. That doesn't actually work.
Comment #7
jhodgdonThere are several places in Drupal core where this is working. For instance, if you have the Database Logging module on, and visit the "Recent Log Entries" report, you can click on the "User" column header and it will sort the report by user name (rather than the default date sort).
This works in both Drupal 7 and Drupal 6.
So I don't think there is a bug in the theme_table() function. You might look at the code in dblog.admin.inc that uses the theme function and see what it is doing that you aren't. And if you feel that the documentation has something left out, please add another comment to this issue.
In the meantime, I think this is a support issue in theming rather than a code or documentation bug in Drupal, and I'm assuming it's Drupal 6.
Comment #8
berdirI just moved a duplicate of this to the documentation issue queue, see #839634: Fix up documentation for table sorting. My post there contains more exact information of what's wrong - theme_table() indicates that 'sort' can be used to define the "default sorting order of a column". However, that is incorrect, 'sort' actually defines the default sorting *column* and the sorting order of that column.
You can't have multiple 'sort' definitions, that results in undefined behavior as the above issue shows. That issue has also a link to a feature request which would allow it.