Skip to content

Commit

Permalink
[BUGFIX] Handle method signature change in TYPO3 12.2
Browse files Browse the repository at this point in the history
  • Loading branch information
NamelessCoder committed Feb 16, 2023
1 parent c8f22a4 commit 767eb22
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Classes/Service/PageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use TYPO3\CMS\Core\Type\Bitmask\PageTranslationVisibility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\RootlineUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;

/**
* Page Service
Expand Down Expand Up @@ -43,12 +44,14 @@ public function getMenu(
$pageConstraints = $this->getPageConstraints($excludePages, $includeNotInMenu, $includeMenuSeparator);
$cacheKey = md5($pageUid . $pageConstraints . (integer) $disableGroupAccessCheck);
if (!isset(static::$cachedMenus[$cacheKey])) {
if ($disableGroupAccessCheck) {
if ($disableGroupAccessCheck
&& version_compare(VersionNumberUtility::getCurrentTypo3Version(), '12.1', '<=')
) {
$pageRepository->where_groupAccess = '';
}

static::$cachedMenus[$cacheKey] = array_filter(
$pageRepository->getMenu($pageUid, '*', 'sorting', $pageConstraints),
$pageRepository->getMenu($pageUid, '*', 'sorting', $pageConstraints, true, !$disableGroupAccessCheck),
function ($page) {
return !$this->hidePageForLanguageUid($page);
}
Expand Down
8 changes: 8 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
parameters:
ignoreErrors:
-
message: "#^Access to protected property TYPO3\\\\CMS\\\\Core\\\\Domain\\\\Repository\\\\PageRepository\\:\\:\\$where_groupAccess\\.$#"
count: 1
path: Classes/Service/PageService.php
-
message: "#^Method TYPO3\\\\CMS\\\\Core\\\\Domain\\\\Repository\\\\PageRepository\\:\\:getMenu\\(\\) invoked with 6 parameters, 1\\-5 required\\.$#"
count: 1
path: Classes/Service/PageService.php
-
message: "#^Parameter \\#2 \\$conf of method TYPO3\\\\CMS\\\\Frontend\\\\ContentObject\\\\ContentObjectRenderer\\:\\:parseFunc\\(\\) expects non-empty-array<string, mixed>\\|null, array\\{\\} given\\.$#"
count: 1
Expand Down

0 comments on commit 767eb22

Please sign in to comment.