Bug #16943
closedSorting of records in a M-M relation
0%
Description
The sorting of the records in a M-M relationship does not inherit the sorting of selected table, but instead sorts on uid.
If you create a table in the kickstarter, you can define what field should be used for sorting.
If you then create another table in the kickstarter, and create an M-M relationship from this 2nd table to the 1st table, the records of the first table are shown both in the BE and in FE (using mth_feedit) sorted on their uid, and not on the field you selected for sorting. This is very irritating for our users who need to browse through 200 records which are not logically sorted!
(issue imported from #M4924)
Files
Updated by Oliver Hader almost 18 years ago
Are you talking about a default sorting, such like alphabetically by title or date, or is it about a manual sorting using up-/down-buttons?
The both tables (entities) should be sorted as defined if you look at them stand-alone. I guess your sorting issue concerns the MM-relation, so if your inside table1 and manage relations to table2? Did I get this right?
Updated by Gerrit Kamp almost 18 years ago
I was talking about default sorting indeed of the table 2. When in MM-relations it does not inherent the default sorting of its own table definition.
You can set the ordering of the child table in the TCA array, using ext_tables.php. It could be an extra feature to the kickstarter though to either set a default sorting for when the table is used in the MM-relationship. If not, I would change the default setting from uid to the selected default for the table itself. Just a minor issue.
Updated by Oliver Hader almost 18 years ago
Okay, I can confirm this as a feature request for TYPO3 4.2.
t3lib_loadDBgroup::readMM() currently doesn't provide a possibility to use a default sorting by the fields defined in $TCA[<table>]['ctrl']['default_sortby']. Tables that are used for storing MM-relations have the fields sorting and sorting_foreign by default. Also the widgets in TCEform, that present the selector-boxes, have to be changed to hide the manual sorting buttons.
To enable the default sorting, I could imagine the following:
$TCA[<table>]['columns'][<field>]['config'] = array(
'type' => 'select',
'MM' => 1,
'default_sortby' => 1
);
Just to set the property "default_sortby" to a true value. Thus the manual sorting will be ignored in t3lib_loadDBgroup::readMM() and TCEforms will hide the sorting buttons, as mentioned above.
Updated by Alexander Opitz over 11 years ago
- Status changed from Accepted to Needs Feedback
- Target version deleted (
0) - TYPO3 Version changed from 4.1 to 4.2
- PHP Version deleted (
4)
As this report is very old, is the handling in newer TYPO3 CMS Versions (like 6.0/6.1) more like you expect it?
Updated by Alexander Opitz about 11 years ago
- Status changed from Needs Feedback to Closed
- Assignee deleted (
Oliver Hader)
No feedback for over 90 days.
Updated by Julian Stock almost 8 years ago
- File Bildschirmfoto 2017-01-16 um 12.23.57.png Bildschirmfoto 2017-01-16 um 12.23.57.png added
- Tracker changed from Feature to Bug
- TYPO3 Version set to 6.2
- Is Regression set to No
When I create an extension with extension builder and use a m-m relation, the values in backend are not sorted in the right order. See attached screenshot.
I checked phpmyadmin and I guess the problem is, that in the first table is just a number that I think is the amount of references to the second table.
Is this intended behaviour?