Issue Feature Rejected

#45577Possibility to sort records in TCEforms by label_userFunc labels

most wanted 02/18/13, 16:55 updated 06/17/24, 19:25

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.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 10

  1. Georg Ringer commented 02/18/13, 17:10

    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. Markus Klein commented 02/18/13, 17:12

    I guess we need manual post-processing in TCEforms

  3. Thomas Mammitzsch commented 02/20/14, 22:18

    no progress on this one? Would be interested too!

  4. Mathias Schreiber commented and changed status New Needs Feedback assigned to Mathias Schreiber 01/26/15, 15:20

    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. most wanted commented 01/26/15, 17:44

    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. Alexander Opitz changed status Needs Feedback New target version 06/16/15, 10:15

  7. Susanne Moog changed Sprint Focus PRC 08/07/15, 10:49

  8. Loon Buster commented and changed priority Should have Must have 10/18/18, 00:41

    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

  9. Benni Mack changed Sprint Focus PRC Needs Decision 03/24/20, 17:52

  10. Georg Ringer commented and changed status New Rejected 06/17/24, 19:25

    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