Given the following table header structure:

Array
(
    [0] => operations
    [1] => Array
        (
            [data] => title
            [field] => n.title
            [sort] => asc
        )
)

Tablesort mostly understands that it should use array[1] to retrieve it's sorting information except for the 'sort' component, which tries to use array[0] and return an 'o' instead of 'asc' or 'desc'. This is mostly a developer usability issue since if header was:

Array
(
    [0] => Array
        (
            [data] => operations
        )
    [1] => Array
        (
            [data] => title
            [field] => n.title
            [sort] => asc
        )
)

It would work as expected.

CommentFileSizeAuthor
tablesort_sort.patch604 bytesmatt westgate
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moshe weitzman’s picture

this patch adds robustness, at very little cost. +1

Dries’s picture

Committed to HEAD and DRUPAL-4-4. Thanks.

Anonymous’s picture

Anonymous’s picture