We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2732fe4 commit 7e45798Copy full SHA for 7e45798
src/lib/Menu/Voter/LocationVoter.php
@@ -34,15 +34,11 @@ public function matchItem(ItemInterface $item): ?bool
34
$contentView = $request->attributes->get('view');
35
$locationId = $route['parameters']['locationId'];
36
37
- if ($contentView instanceof ContentView) {
38
- $location = $contentView->getLocation();
39
- if ($location !== null) {
40
- $path = $location->getPath();
41
-
42
- if (in_array($locationId, $path, true)) {
43
- return true;
44
- }
45
+ if ($contentView instanceof ContentView && in_array(
+ $locationId,
+ $contentView->getLocation()->path ?? [$contentView->getLocation()->id]
+ )) {
+ return true;
46
}
47
48
0 commit comments