Project

General

Profile

Actions

Bug #16943

closed

Sorting of records in a M-M relation

Added by Gerrit Kamp over 17 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2007-02-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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

Bildschirmfoto 2017-01-16 um 12.23.57.png (68.8 KB) Bildschirmfoto 2017-01-16 um 12.23.57.png Wrong sorting of field "Niederlassung" Julian Stock, 2017-01-16 12:26
Actions #1

Updated by Oliver Hader over 17 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?

Actions #2

Updated by Gerrit Kamp over 17 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.

Actions #3

Updated by Oliver Hader over 17 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.

Actions #4

Updated by Alexander Opitz about 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?

Actions #5

Updated by Alexander Opitz almost 11 years ago

  • Status changed from Needs Feedback to Closed
  • Assignee deleted (Oliver Hader)

No feedback for over 90 days.

Actions #6

Updated by Julian Stock over 7 years ago

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?

Actions

Also available in: Atom PDF