Bug #71044

CE Special/Menu Order by ID

Added by M S almost 4 years ago. Updated 12 months ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Fluid Styled Content
Start date:
2015-10-26
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The content element "Special/Menu" renders (fluid_styled_content) the links (sites) by PID. Normaly (6.2 and erlier) TYPO3 uses the same sort as the backend.

Bildschirmfoto 2016-07-28 um 09.12.33.png View (24.2 KB) Nando Bosshart, 2016-07-28 09:16


Related issues

Related to TYPO3 Core - Bug #73757: Special Menus - Menu of selected pages sorting not possible Closed 2016-02-29
Related to TYPO3 Core - Bug #78783: CE Special/Menu type "directory" sorting New 2016-11-24

Associated revisions

Revision 22b393c5 (diff)
Added by Johannes Schlier almost 3 years ago

[BUGFIX] Fix special menu element redered in wrong order

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 <>
Reviewed-by: Frank Naegler <>
Reviewed-by: Markus Sommer <>
Tested-by: Markus Sommer <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

Revision 9caa7aab (diff)
Added by Johannes Schlier almost 3 years ago

[BUGFIX] Fix special menu element rendered in wrong order

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 <>
Tested-by: Benni Mack <>

History

#1 Updated by Mathias Schreiber almost 4 years ago

  • Category set to Fluid Styled Content
  • Assignee set to Benni Mack
  • Priority changed from Should have to Must have

#2 Updated by Riccardo De Contardi over 3 years ago

  • Target version changed from 7 LTS to Candidate for patchlevel

#3 Updated by Stephan Brun over 3 years ago

The problem can be solved in the Viewhelper (\TYPO3\CMS\FluidStyledContent\ViewHelpers\Menu\ListViewHelper).
Sort the $pages array after the getMenuForPages().

Maybe there is a better solution.

Here is my fix:

// get the same sortorder as in the backend
$tempPagesForSort = [];
foreach ($pageUids as $pageUid) {
    if($pages[$pageUid]) {
        $tempPagesForSort[$pageUid] = $pages[$pageUid];
    }
}
$pages = $tempPagesForSort;

Would be nice to have a fix in the core. Thanks.

#4 Updated by Nando Bosshart over 3 years ago

+1 - please fix this in the ViewHelper

#5 Updated by Riccardo De Contardi over 3 years ago

+1 I agree :)

#6 Updated by hwt3 no-lastname-given about 3 years ago

+1 This is a must have.

Optimally there should be an option to decide, if to sort via pagetree or order in selection field. At least via ts setting.

#7 Updated by Kai Kretschmann about 3 years ago

Is that patch planned for any upcoming 7.6.10 version?

As it is a real bug (no one sorts intentionally by internal pageID) I hope for a quick solution.

And for the long term I would like to influence the sorting options of those oobjects myself.

#8 Updated by Nando Bosshart about 3 years ago

it's still not fixed in 7.6.10 :-(
the provided patch still works fine with it.

#9 Updated by Robert Wenk about 3 years ago

+1
I agree. Nobody needs sorting by UID.
Please fix it in 7.6.11.

I think, the bug could easy be fixed by adding the default parameter when calling $typoScriptFrontendController->sys_page->getMenuForPages.
At this time an empty string is passed to getMenuForPages, but this is not recognised as empty so the default "sorting" doesn't kick in.

typo3/sysext/fluid_styled_content/Classes/ViewHelpers/Menu/ListViewHelper.php

Line 72 to 77 contains

$pages = $typoScriptFrontendController->sys_page->getMenuForPages(
$pageUids,
'*',
Problem --->'',
$this->getPageConstraints($includeNotInMenu, $includeMenuSeparator)
);

Fix it by setting the default

$pages = $typoScriptFrontendController->sys_page->getMenuForPages(
$pageUids,
'*',
'sorting',
$this->getPageConstraints($includeNotInMenu, $includeMenuSeparator)
);

#10 Updated by Gerrit Code Review about 3 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/49188

#11 Updated by Nando Bosshart about 3 years ago

Robert Wenk: I tested your Patch but it solves not all usage-scenarios with the menu-CE.
If you want to use a "menu with selected pages" you can sort them in the corresponding backend-field - and this sorting needs to be respected as well. Stephans patch (https://forge.typo3.org/issues/71044#note-3) solves this problem

#12 Updated by sas no-lastname-given about 3 years ago

Hi, the problem isn't fixed in 7.6.10 and 7.6.11 like Nando already said. I don't want to edit core files and hope it will be fixed in upcoming 7.6.12!!!
At the moment I try to sort the files/pages with the `vhs`Extension ([[https://fluidtypo3.org/viewhelpers/vhs/1.0.1/Iterator/SortViewHelper.html]])

Type-0.html

<f:comment><!--<f:for each="{pages}" as="page">--></f:comment>
<f:for each="{pages->v:iterator.sort(order: 'ASC', sortBy: 'name')}" as="page">

#13 Updated by Gerrit Code Review almost 3 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/50214

#14 Updated by Gerrit Code Review almost 3 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/50214

#15 Updated by Joe Jones almost 3 years ago

  • TYPO3 Version changed from 7 to 8

Gerrit Code Review wrote:

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/50214

Issue also in TYPO3 8.3. The patch of viewhelper works. Please include in next TYPO3 8 release as well. Thank you.

#16 Updated by Anonymous almost 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#17 Updated by Gerrit Code Review almost 3 years ago

  • Status changed from Resolved to Under Review

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/50247

#18 Updated by Gerrit Code Review almost 3 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/50247

#19 Updated by Anonymous almost 3 years ago

  • Status changed from Under Review to Resolved

#20 Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF