Bug #71044

CE Special/Menu Order by ID

Added by M S about 6 years ago. Updated about 3 years ago.

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

100%

Estimated time:
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.


Files


Related issues

Related to TYPO3 Core - Bug #73757: Special Menus - Menu of selected pages sorting not possibleClosed2016-02-29

Actions
Related to TYPO3 Core - Bug #78783: CE Special/Menu type "directory" sortingClosedBenni Mack2016-11-24

Actions
#1

Updated by Mathias Schreiber about 6 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 almost 6 years ago

  • Target version changed from 7 LTS to Candidate for patchlevel
#3

Updated by Stephan Brun almost 6 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 almost 6 years ago

+1 - please fix this in the ViewHelper

#5

Updated by Riccardo De Contardi over 5 years ago

+1 I agree :)

#6

Updated by hwt3 no-lastname-given over 5 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 over 5 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 over 5 years ago

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

#9

Updated by Robert Wenk over 5 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 over 5 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 over 5 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 5 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 about 5 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 about 5 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 about 5 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 about 5 years ago

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

Updated by Gerrit Code Review about 5 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 about 5 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 about 5 years ago

  • Status changed from Under Review to Resolved
#20

Updated by Benni Mack about 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF