Project

General

Profile

Actions

Bug #82263

closed

Sys_file_reference child Objects are not sorted by "foreign_sortby"

Added by Frederik Holz about 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2017-08-31
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Creating a column for Sys File Reference like this

'downloads' => [
            'label' => $languagePath . 'download.downloads',
            'l10n_mode' => 'noCopy',
            'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('downloads',
                [
                    'foreign_types' => [
                        '0' => [
                            'showitem' => '
                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
                            --palette--;;filePalette'
                        ],
                        \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
                            'showitem' => '
                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
                            --palette--;;filePalette'
                        ],
                        \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
                            'showitem' => '
                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
                            --palette--;;filePalette'
                        ],
                        \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
                            'showitem' => '
                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.audioOverlayPalette;audioOverlayPalette,
                            --palette--;;filePalette'
                        ],
                        \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
                            'showitem' => '
                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.videoOverlayPalette;videoOverlayPalette,
                            --palette--;;filePalette'
                        ],
                        \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
                            'showitem' => '
                            --palette--;LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
                            --palette--;;filePalette'
                        ]
                    ],
                    'minitems' => 1
                ]
            ),
        ],

Does not sort the downloads when accessing the Parent via the controller or fluid.

Considering a simple Element Download with name and files. Files is a TCA config like above.
Adding 3-4 Files in the backend and change the order of them.
Use $this->downloadRepository->findAll() and iterate in fluid over "files" does not show them like sorted in the backend.
The SQL Query does not contain an ORDER BY part so the files are Ordered by the uid instead of the sorting field.

Changing 'foreign_sortby' to something else does not help, because the query is always called without any ORDER BY

Actions #1

Updated by Frederik Holz about 7 years ago

  • Priority changed from Should have to Must have
Actions #2

Updated by Susanne Moog over 5 years ago

  • Status changed from New to Needs Feedback

Thanks for the report, can you describe your use case a bit more?

As far as I understood you have "some table" with a field "downloads" which contains file references that you can sort in the backend.

Then you have a DownloadRepository for "some table" where you simply call findAll and expect it to get elements as they are sorted in the backend? If that's correct, can you check if this solution: https://stackoverflow.com/questions/25807394/typo3-extbase-how-to-sort-child-objects works for you?

Actions #3

Updated by Riccardo De Contardi over 5 years ago

  • Status changed from Needs Feedback to Closed

No feedback since the last 90 days => closing this issue.

If you think that this is the wrong decision or experience the issue again and have more information about how to reproduce your problem, please reopen it or ping me.

Thank you and best regards

Actions

Also available in: Atom PDF