From a87f5828e4de8d9879184eecd9806c17f0d8d91d Mon Sep 17 00:00:00 2001 From: Bartek Date: Wed, 29 Jul 2020 16:38:42 +0200 Subject: [PATCH] EZP-31584: Fixed broken tests for LocationResolver (#92) --- .../LocationResolver/PermissionAwareLocationResolver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eZ/Publish/Core/Repository/LocationResolver/PermissionAwareLocationResolver.php b/eZ/Publish/Core/Repository/LocationResolver/PermissionAwareLocationResolver.php index 44b7269d76..561b2fb288 100644 --- a/eZ/Publish/Core/Repository/LocationResolver/PermissionAwareLocationResolver.php +++ b/eZ/Publish/Core/Repository/LocationResolver/PermissionAwareLocationResolver.php @@ -44,7 +44,7 @@ public function resolveLocation(ContentInfo $contentInfo): Location } catch (NotFoundException | UnauthorizedException $e) { // try different locations if main location is not accessible for the user $locations = $this->locationService->loadLocations($contentInfo); - if (empty($locations)) { + if (empty($locations) || null === $contentInfo->mainLocationId) { throw $e; }