[BUGFIX] Ensure correct sorting of extension configuration 80/51980/2
authorNicole Cordes <typo3@cordes.co>
Tue, 7 Mar 2017 22:18:00 +0000 (23:18 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Thu, 23 Mar 2017 13:23:21 +0000 (14:23 +0100)
If an extension uses a default subcategory for its configuration but does
not define a sorting order, using PHP >= 7 the order is reversed. This
patch ensures an previously introduced counter is used as identifier.

Resolves: #80180
Related: #76386
Releases: master, 7.6
Change-Id: Ib480632213ebe090688da5ba30c031ca116cf9a9
Reviewed-on: https://review.typo3.org/51980
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php

index 806b3f4..af334bc 100644 (file)
@@ -958,8 +958,9 @@ class ExtendedTemplateService extends TemplateService
                                 $catSplit[1] = trim($catSplit[1]);
                                 if ($catSplit[1] && isset($this->subCategories[$catSplit[1]])) {
                                     $editableComments[$const]['subcat_name'] = $catSplit[1];
+                                    $orderIdentifier = isset($catSplit[2]) ? trim($catSplit[2]) : $counter;
                                     $editableComments[$const]['subcat'] = $this->subCategories[$catSplit[1]][1]
-                                        . '/' . $catSplit[1] . '/' . trim($catSplit[2]) . 'z';
+                                        . '/' . $catSplit[1] . '/' . $orderIdentifier . 'z';
                                 } elseif (isset($catSplit[2])) {
                                     $editableComments[$const]['subcat'] = 'x' . '/' . trim($catSplit[2]) . 'z';
                                 } else {