Skip to content

Commit

Permalink
Fixed groups and page ID
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Nov 11, 2024
1 parent 54f6762 commit c2d9c19
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Classes/Base/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ protected static function addAccess(\Aimeos\Base\View\Iface $view) : \Aimeos\Bas

if ($appType && $appType->isBackend()) {
if ($t3context->getPropertyFromAspect('backend.user', 'isAdmin', false) === false) {
$ids = $t3context->getPropertyFromAspect('backend.user', 'groupIds', []);
$ids = array_filter($t3context->getPropertyFromAspect('backend.user', 'groupIds', []), fn ($id) => $id > 0);
$names = $t3context->getPropertyFromAspect('backend.user', 'groupNames', []);
$helper = new \Aimeos\Base\View\Helper\Access\Standard($view, array_combine($ids, $names));
} else {
$helper = new \Aimeos\Base\View\Helper\Access\All($view);
}
} else {
if ($t3context->getPropertyFromAspect('frontend.user', 'isLoggedIn', false)) {
$ids = $t3context->getPropertyFromAspect('frontend.user', 'groupIds', []);
$ids = array_filter($t3context->getPropertyFromAspect('frontend.user', 'groupIds', []), fn ($id) => $id > 0);
$names = $t3context->getPropertyFromAspect('frontend.user', 'groupNames', []);
$helper = new \Aimeos\Base\View\Helper\Access\Standard($view, array_combine($ids, $names));
} else {
Expand Down Expand Up @@ -347,6 +347,7 @@ protected static function addUrl(\Aimeos\Base\View\Iface $view, \Aimeos\Base\Con
}

$fixed = [];
$pageId = 0;

if ($request && $request->getAttribute('applicationType') === 1) { // for frontend requests only
$name = $config->get('typo3/param/name/site', 'site');
Expand All @@ -368,9 +369,9 @@ protected static function addUrl(\Aimeos\Base\View\Iface $view, \Aimeos\Base\Con
if ($request !== null && $request->hasArgument($name) === true) {
$fixed[$name] = $request->getArgument($name);
}
}

$pageId = $request ? $request->getAttribute('routing')->getPageId() : 0;
$pageId = $request->getAttribute('routing')->getPageId();
}

if ($uriBuilder instanceof \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder) {
$url = new \Aimeos\Base\View\Helper\Url\Typo3($view, $uriBuilder->setTargetPageUid( $pageId ), $fixed);
Expand Down

0 comments on commit c2d9c19

Please sign in to comment.