'Strange behaviour if foreign_sortby used in IRRE records
I try to sort IRRE records by start (a date) automatically with foreign_sortby in the parents TCA with:
'holidays' => [
'exclude' => true,
'label' => 'LLL:EXT:my_extension/Resources/Private/Language/locallang_db.xlf:tx_myextension_domain_model_feusers.holidays',
'config' => [
'type' => 'inline',
'foreign_table' => 'tx_myextension_domain_model_holiday',
'foreign_field' => 'feusers',
'foreign_sortby' => 'start',
'maxitems' => 9999,
'appearance' => [
'collapseAll' => 1,
'levelLinksPosition' => 'top',
'showSynchronizationLink' => 1,
'showPossibleLocalizationRecords' => 1,
'showAllLocalizationLink' => 1
],
],
],
This works fine in BE an FE. But the field start is with this setting no more visible in the BE form of the parent record.
The child has only 2 date fields, start and end.
Child record with start field:
Parent record with missing start field:
(source: honrath.de)
What is my mistake?
Solution 1:[1]
The solution is replacing:
'foreign_sortby' => 'start',
with:
'foreign_default_sortby' => 'ORDER BY start ASC',
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | exotec |