[BUGFIX] Ensure ordering of TS constants in editor 13/48413/2
authorMarkus Klein <markus.klein@typo3.org>
Tue, 31 May 2016 09:04:29 +0000 (11:04 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Mon, 6 Jun 2016 13:58:34 +0000 (15:58 +0200)
Resolves: #76386
Releases: master, 7.6
Change-Id: I827b6ab143520f647668773411d3b67792299c97
Reviewed-on: https://review.typo3.org/48413
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php

index 7fa52a7..5fbd70c 100644 (file)
@@ -916,10 +916,12 @@ class ExtendedTemplateService extends TemplateService
     public function ext_compareFlatSetups($default)
     {
         $editableComments = array();
+        $counter = 0;
         foreach ($this->flatSetup as $const => $value) {
             if (substr($const, -2) === '..' || !isset($this->flatSetup[$const . '..'])) {
                 continue;
             }
+            $counter++;
             $comment = trim($this->flatSetup[$const . '..']);
             $c_arr = explode(LF, $comment);
             foreach ($c_arr as $k => $v) {
@@ -951,8 +953,10 @@ class ExtendedTemplateService extends TemplateService
                                     $editableComments[$const]['subcat_name'] = $catSplit[1];
                                     $editableComments[$const]['subcat'] = $this->subCategories[$catSplit[1]][1]
                                         . '/' . $catSplit[1] . '/' . trim($catSplit[2]) . 'z';
-                                } else {
+                                } elseif (isset($catSplit[2])) {
                                     $editableComments[$const]['subcat'] = 'x' . '/' . trim($catSplit[2]) . 'z';
+                                } else {
+                                    $editableComments[$const]['subcat'] = 'x' . '/' . $counter . 'z';
                                 }
                                 break;
                             case 'label':