Bug #19483
closedalternativeSortingField does not work for other languages
0%
Description
If you build a TMENU with an alternativeSortingField-entry, in the default language, the sort-order is right. if you switch the language, the menu-entries are translated, but keep the sort-order of the default-language. the cause is, that alternativeSortingField only sorts the table `pages`.
i wrote a quick and dirty solution to my problem:
the behaviour of alternativeSortingField is right. it sorts the table-entries. so i made another directive called "alternativeSortingField2" which sorts the entries, after they are completely cummulated.
example:
menu = HMENU
menu {
entryLevel = 3
1 = TMENU
1 {
alternativeSortingField2 = title ASC
}
}
i changed the code of typo3/sysext/cms/tslib/class.tslib_menu.php in typo3 4.2.0 after line 831:
$altSortField2 = trim($this->mconf['alternativeSortingField2']);
if(isset($altSortField2) && $altSortField2 != '') {
$altSortField2 = preg_split('/[\\s,]+/s',$altSortField2);
if(!isset($altSortField21)) $altSortField21 = 'ASC';
else $altSortField21 = strtoupper($altSortField21);
$type = 'string';
foreach($temp as $gettype) {
if(isset($gettype[$altSortField20])) $type = gettype($gettype[$altSortField20]);
break;
}
$lFunc = 'return strcmp($a["'.$altSortField20.'"],$b["'.$altSortField20.'"]);';
if($type != 'integer' && $type != 'double') {
if($altSortField21 == 'DESC') {
$lFunc = 'return strcmp($b["'.$altSortField20.'"],$a["'.$altSortField20.'"]);';
}
} else {
if($altSortField21 'DESC') {
$lFunc = 'if ($a["'.$altSortField2[0].'"] $b["'.$altSortField20.'"]) { return 0; }'.
' return ($a["'.$altSortField20.'"] < $b["'.$altSortField20.'"]) ? -1 : 1;';
} else {
$lFunc = 'if ($a["'.$altSortField20.'"] == $b["'.$altSortField20.'"]) { return 0; }'.
' return ($b["'.$altSortField20.'"] < $a["'.$altSortField20.'"]) ? -1 : 1;';
}
}
$lambda = create_function('$a,$b',$lFunc);
uasort($temp,$lambda);
}
(issue imported from #M9606)
Files
Updated by Manuel Stofer about 16 years ago
i also think there should be two sorting functions, that you can sort from original page and language overlay. for example you might want to sort with crdate (either sorted with the crdate of original page or with language overlay).
but i think sorting should not be done on database table field level. you might want to sort with nav_title of language overlay page, if nav_title is not specified in Language overlaypage you will want to use title of the language overlay page to sort.
Updated by Stefan Sprenger over 14 years ago
I've added a patch that fixes the wrong behavior for menus having type "directory".
Updated by Chris topher almost 14 years ago
Hi guys,
is that problem still present?
If so, please push the patch to Gerrit!
Updated by Tomas Norre Mikkelsen about 12 years ago
- Target version deleted (
0)
Hi,
I can confirm that this is still a problem in TYPO3 4.7.2 dont know for 4.7.3/4
/Tomas
Updated by Manuel Selbach almost 10 years ago
- Target version set to next-patchlevel
I would really appreciate if you could include this issue in the next minor update.
Updated by Christian Kuhn over 9 years ago
- Description updated (diff)
- Is Regression set to No
still present in current core versions ...
Updated by Mathias Schreiber about 9 years ago
- Target version deleted (
next-patchlevel)
Updated by Gerrit Code Review almost 8 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51506
Updated by Gerrit Code Review almost 8 years ago
Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51507
Updated by Gerrit Code Review almost 8 years ago
Patch set 2 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51507
Updated by Gerrit Code Review almost 8 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51508
Updated by Gerrit Code Review almost 8 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51508
Updated by Gerrit Code Review almost 8 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51508
Updated by Gerrit Code Review almost 8 years ago
Patch set 3 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51507
Updated by Gerrit Code Review almost 8 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51508
Updated by Gerrit Code Review almost 8 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51508
Updated by Gerrit Code Review almost 8 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51508
Updated by Gerrit Code Review almost 8 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51508
Updated by Gerrit Code Review almost 8 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51508
Updated by Gerrit Code Review over 6 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51508
Updated by Benni Mack about 6 years ago
- Status changed from Under Review to New
Updated by Eric Harrer over 1 year ago
- Related to Story #101560: FlexForm related translation issues added
Updated by Eric Harrer over 1 year ago
Since in current TYPO3 versions pages of all languages are stored in the same table, my question is: Is this still a problem in current TYPO3 versions?
Updated by Eric Harrer over 1 year ago
- Related to deleted (Story #101560: FlexForm related translation issues)
Updated by Eric Harrer over 1 year ago
- Related to Epic #101557: Translation Handling Findings added
Updated by Christian Kuhn about 1 year ago
- Status changed from New to Closed
Yeah. I suppose it's ok to close here for now.