[BUGFIX] Fix special menu element redered in wrong order 14/50214/3
authorJohannes Schlier <johannes.schlier@b13.de>
Thu, 13 Oct 2016 13:34:29 +0000 (15:34 +0200)
committerBenni Mack <benni@typo3.org>
Mon, 17 Oct 2016 15:55:33 +0000 (17:55 +0200)
The ListViewHelper gets an array with the uids to display in the special
menu, configured from the plug-in.
The rendered elements were not ordered according to the plug-in settings.
With this patch the returned pages are ordered according to the order of
the uids in the array.

Resolves: #71044
Releases: master, 7.6
Change-Id: I8b54aa32f1221e7849010e7761c5f04859b4dcea
Reviewed-on: https://review.typo3.org/50214
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Markus Sommer <markussom@posteo.de>
Tested-by: Markus Sommer <markussom@posteo.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/fluid_styled_content/Classes/ViewHelpers/Menu/ListViewHelper.php

index bead52d..3f52829 100644 (file)
@@ -80,6 +80,14 @@ class ListViewHelper extends AbstractMenuViewHelper
             $this->getPageConstraints($includeNotInMenu, $includeMenuSeparator)
         );
 
+        $tempPagesForSort = [];
+        foreach ($pageUids as $pageUid) {
+            if ($pages[$pageUid]) {
+                $tempPagesForSort[$pageUid] = $pages[$pageUid];
+            }
+        }
+        $pages = $tempPagesForSort;
+
         $output = '';
 
         if (!empty($pages)) {