Bug #39531

sortby field in TCA used to introduce custom sorting sets contents to integers

Added by Anja Leichsenring 11 months ago. Updated 10 months ago.

Status:Rejected Start date:2012-08-04
Priority:Must have Due date:
Assignee:- % Done:

100%

Category:Extbase
Target version:Extbase 6.0
Has patch:No Tags:
Votes: 0

Description

(I am not so sure this is a extbase bug?)

If you set the sortby field in config part of TCA to a field different from 'sorting', any sorting action in Backend leads to changing the values of this field to integer values presenting the sorting.

Like this:
$TCA['table] = array(
'ctrl' => array(
...
'sortby' => 'name',
...
)
)

Values of name before any sorting action:
uid name
1 bla
2 foo
3 bar

Values after sorting
uid name
1 256
2 1024
3 2048

History

Updated by Jacob Rasmussen 11 months ago

  • % Done changed from 0 to 100

Hi Anja,

This is not a bug - according to the TCA documentation http://typo3.org/documentation/document-library/core-documentation/doc_core_tca/4.7.1/view/1/3/#id581956
It clearly states that the sortby field contains an integer value which will be used for positioning elements relative to each other.
If you wish to order by the content of a column, you should use default_sortby instead - which is also documented in the TCA documentation.

Please make sure that the string begins with ORDER BY

Rgds
Jacob

Updated by Anja Leichsenring 10 months ago

  • Status changed from New to Rejected

this is no bug, but a user error.

Also available in: Atom PDF