[BUGFIX] Fix special menu element rendered in wrong order 47/50247/3
authorJohannes Schlier <johannes.schlier@b13.de>
Thu, 13 Oct 2016 13:34:29 +0000 (15:34 +0200)
committerBenni Mack <benni@typo3.org>
Tue, 18 Oct 2016 04:40:49 +0000 (06:40 +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/50247
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 a6e161e..779f2a0 100644 (file)
@@ -76,6 +76,14 @@ class ListViewHelper extends AbstractViewHelper
             $this->getPageConstraints($includeNotInMenu, $includeMenuSeparator)
         );
 
+        $tempPagesForSort = [];
+        foreach ($pageUids as $pageUid) {
+            if ($pages[$pageUid]) {
+                $tempPagesForSort[$pageUid] = $pages[$pageUid];
+            }
+        }
+        $pages = $tempPagesForSort;
+
         $output = '';
 
         if (!empty($pages)) {