Project

General

Profile

Actions

Bug #71044

closed

CE Special/Menu Order by ID

Added by M S about 9 years ago. Updated about 6 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 2 (0 open2 closed)

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
Actions #1

Updated by Mathias Schreiber about 9 years ago

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

Updated by Riccardo De Contardi almost 9 years ago

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

Updated by Stephan Brun over 8 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.

Actions #4

Updated by Nando Bosshart over 8 years ago

+1 - please fix this in the ViewHelper

Actions #5

Updated by Riccardo De Contardi over 8 years ago

+1 I agree :)

Actions #6

Updated by hwt3 no-lastname-given over 8 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.

Actions #7

Updated by Kai Kretschmann over 8 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.

Actions #8

Updated by Nando Bosshart over 8 years ago

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

Actions #9

Updated by Robert Wenk over 8 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)
);
Actions #10

Updated by Gerrit Code Review over 8 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

Actions #11

Updated by Nando Bosshart over 8 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

Actions #12

Updated by sas no-lastname-given about 8 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">
Actions #13

Updated by Gerrit Code Review about 8 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

Actions #14

Updated by Gerrit Code Review about 8 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

Actions #15

Updated by Joe Jones about 8 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.

Actions #16

Updated by Anonymous about 8 years ago

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

Updated by Gerrit Code Review about 8 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

Actions #18

Updated by Gerrit Code Review about 8 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

Actions #19

Updated by Anonymous about 8 years ago

  • Status changed from Under Review to Resolved
Actions #20

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF