Commit 07638213 authored by Benni Mack's avatar Benni Mack Committed by Oliver Bartsch
Browse files

[BUGFIX] Allow rendering of subpages for spacers

If rendering of spacer pages in an HMENU is explicitly
given via SPC = 1, then subpages of pages are now rendered
as well.

This way, there is no difference between spacers and other
page types for submenu rendering anymore.

Resolves: #64428
Releases: main, 11.5
Change-Id: Ic4bc2661399498de61af486712ade85815ffa529
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72840


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent 0ce25043
......@@ -191,8 +191,11 @@ class TextMenuContentObject extends AbstractMenuContentObject
*/
protected function extProc_afterLinking($key)
{
// Add part to the accumulated result + fetch submenus
if (!$this->I['spacer']) {
$explicitSpacerRenderingEnabled = ($this->mconf['SPC'] ?? false);
$isSpacerPage = $this->I['spacer'] ?? false;
// If rendering of SPACERs is enabled, also allow rendering submenus with Spacers
if (!$isSpacerPage || $explicitSpacerRenderingEnabled) {
// Add part to the accumulated result + fetch submenus
$this->I['theItem'] .= $this->subMenu($this->I['uid'], $this->WMsubmenuObjSuffixes[$key]['sOSuffix'] ?? '');
}
$part = $this->WMcObj->stdWrapValue('wrapItemAndSub', $this->I['val']);
......
......@@ -2,6 +2,7 @@ __variables:
- &pageStandard 0
- &pageShortcut 4
- &pageMount 7
- &pageSpacer 199
- &pageFolder 254
- &contentText 'text'
- &idAcmeRootPage 1000
......@@ -92,6 +93,9 @@ entities:
languageVariants:
- self: {id: 1411, title: 'FR: Groups', language: 1, slug: '/acme-dans-votre-region/groupes'}
- self: {id: 1412, title: 'FR-CA: Groups', language: 2, slug: '/acme-dans-votre-quebec/groupes'}
- self: {id: 1450, type: *pageSpacer, title: 'Divider', slug: '/divider'}
children:
- self: {id: 1460, title: 'EN: Subpage of Spacer', slug: '/divider/subpage-of-spacer' }
- self: {id: 1500, title: 'Internal', slug: '/my-acme'}
children:
- self: {id: 1510, title: 'Whitepapers', visitorGroups: -2, extendToSubpages: true, slug: '/my-acme/whitepapers'}
......
......@@ -715,6 +715,16 @@ class SlugLinkGeneratorTest extends AbstractTestCase
],
],
['title' => 'EN: ACME in your Region', 'link' => '/acme-in-your-region'],
[
'title' => 'Divider',
'link' => '/divider',
'children' => [
[
'title' => 'EN: Subpage of Spacer',
'link' => '/divider/subpage-of-spacer',
],
],
],
['title' => 'Internal', 'link' => '/my-acme'],
['title' => 'About us', 'link' => '/about'],
[
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment