Skip to content

Commit

Permalink
[BUGFIX] Allow rendering of subpages for spacers
Browse files Browse the repository at this point in the history
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 <typo3@b13.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
  • Loading branch information
bmack authored and o-ba committed Jan 3, 2022
1 parent 0ce2504 commit 0763821
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,11 @@ protected function getBeforeAfter($pref)
*/
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']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ __variables:
- &pageStandard 0
- &pageShortcut 4
- &pageMount 7
- &pageSpacer 199
- &pageFolder 254
- &contentText 'text'
- &idAcmeRootPage 1000
Expand Down Expand Up @@ -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'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,16 @@ public function hierarchicalMenuIsGeneratedDataProvider(): array
],
],
['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'],
[
Expand Down

0 comments on commit 0763821

Please sign in to comment.