Feature #45577
closed
Possibility to sort records in TCEforms by label_userFunc labels
Added by most wanted almost 12 years ago.
Updated 5 months ago.
Category:
FormEngine aka TCEforms
Sprint Focus:
Needs Decision
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.
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....
I guess we need manual post-processing in TCEforms
no progress on this one? Would be interested too!
- 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.
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.
- Status changed from Needs Feedback to New
- Target version deleted (
6.1.0)
- 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
- Sprint Focus changed from PRC to Needs Decision
- 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
Also available in: Atom
PDF