Feature #45577
closedPossibility to sort records in TCEforms by label_userFunc labels
0%
Description
You can use label_userFunc to display meaningful custom labels for each record of a table in TCEforms. At the moment it is not possible to sort the records by this custom labels.
$TCA['table_name']['ctrl']['sortby'] and
$TCA['table_name']['ctrl']['default_sortby'] do not work for this task.
It would be useful if you could sort records in TCEforms by label_userFunc labels.
Updated by Georg Ringer almost 12 years ago
but how should this work? sorting works via mysql but with user defined labels it is impossible to know the title without rendering every one of them....
Updated by Markus Klein almost 12 years ago
I guess we need manual post-processing in TCEforms
Updated by Thomas Mammitzsch almost 11 years ago
no progress on this one? Would be interested too!
Updated by Mathias Schreiber almost 10 years ago
- Status changed from New to Needs Feedback
- Assignee set to Mathias Schreiber
We need a solid concept for this.
Like Georg said, sorting takes place on a very very low level of the DB without any PHP logic involved.
Pulling PHP in between sounds like the most under-performing thing I could possibly imagine.
So in case there is a solid concept, I'm willing to dig into this.
Otherwise I'd just close this one down.
Updated by most wanted almost 10 years ago
i still think this would be a useful feature. infact i think you could even call the current behaviour a bug: when an editor tries to sort by such a label it does not necessarily sort as expected by the editor.
i can understand the need for a solid concept. i myself could not find a clean solution back then, but i am not that much into the TYPO3 core.
my rough ideas involved additional database table fields (integer) solely used for sorting in the TYPO3 backend. those fields would be updated when necessary (asynchonously but as promptly as possible) in the background.
Updated by Alexander Opitz over 9 years ago
- Status changed from Needs Feedback to New
- Target version deleted (
6.1.0)
Updated by Loon Buster about 6 years ago
- Priority changed from Should have to Must have
hello.
..workaround:
1) add a column 'label' to your table.
2)
// .. Configuration/TCA/tx_table_xyz.php 'label_userFunc' => \MyVendor\MyExtension\Userfuncs\Tca::class . '->mylabel', 'default_sortby' => 'label',
3)
// .. Classes/Userfuncs/Tca.php > mylable $parameters['title']=$newtitleXYZ; if($_GET['edit'] & $parameters['row']){ $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_table_xyz','(uid='.$parameters['row']['uid'].')',['label' => $parameters['title']]); }
.loon
Updated by Benni Mack over 4 years ago
- Sprint Focus changed from PRC to Needs Decision
Updated by Georg Ringer 5 months ago
- Status changed from New to Rejected
hey!
as this issue is quite old and the "workaround" is having a custom label field is totally easy to implement and also what the core would do I am closing this issue as won't fix