[BUGFIX] Show sectionIndex from referenced page 95/27995/10
authorNico de Haen <mail@ndh-websolutions.de>
Mon, 3 Mar 2014 13:55:06 +0000 (14:55 +0100)
committerBenjamin Mack <benni@typo3.org>
Sat, 9 May 2015 13:48:19 +0000 (15:48 +0200)
If a page is configured to show content from another pid the menu
of type sectionIndex has to fetch the content elements from the
referenced page instead of the page itself.

Thanks to Christian Finkemeyer for the patch.

Resolves: #46448
Releases: master, 6.2
Change-Id: Ia903cdc085dd665f89df5c90dad962cbc9f09535
Reviewed-on: http://review.typo3.org/27995
Reviewed-by: Stephan Großberndt <stephan@grossberndt.de>
Tested-by: Stephan Großberndt <stephan@grossberndt.de>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php

index acd04aa..6207c4f 100644 (file)
@@ -2079,6 +2079,11 @@ abstract class AbstractMenuContentObject {
                        'languageField' => 'sys_language_uid',
                        'where' => $useColPos >= 0 ? 'colPos=' . $useColPos : ''
                );
+               if ($basePageRow['content_from_pid']) {
+                       // If the page is configured to show content from a referenced page the sectionIndex contains only contents of
+                       // the referenced page
+                       $selectSetup['pidInList'] = $basePageRow['content_from_pid'];
+               }
                $resource = $this->parent_cObj->exec_getQuery('tt_content', $selectSetup);
                if (!$resource) {
                        $message = 'SectionIndex: Query to fetch the content elements failed!';