Feature #45577

Possibility to sort records in TCEforms by label_userFunc labels

Added by most wanted over 6 years ago. Updated 8 months ago.

Status:
New
Priority:
Must have
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2013-02-18
Due date:
% Done:

0%

PHP Version:
Tags:
Complexity:
Sprint Focus:
PRC

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.

History

#1 Updated by Georg Ringer over 6 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....

#2 Updated by Markus Klein over 6 years ago

I guess we need manual post-processing in TCEforms

#3 Updated by Thomas Mammitzsch over 5 years ago

no progress on this one? Would be interested too!

#4 Updated by Mathias Schreiber over 4 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.

#5 Updated by most wanted over 4 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.

#6 Updated by Alexander Opitz about 4 years ago

  • Status changed from Needs Feedback to New
  • Target version deleted (6.1.0)

#7 Updated by Susanne Moog almost 4 years ago

  • Sprint Focus set to PRC

#8 Updated by Loon Buster 8 months 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

Also available in: Atom PDF