diff --git a/Classes/DataProcessing/FilesCategoryProcessor.php b/Classes/DataProcessing/FilesCategoryProcessor.php index f1fe134..31110a0 100644 --- a/Classes/DataProcessing/FilesCategoryProcessor.php +++ b/Classes/DataProcessing/FilesCategoryProcessor.php @@ -77,7 +77,7 @@ public function process( $this->legacyReturn ? ['properties', $categoriesAs] : $categoriesAs, array_map(function (int $categoryUid) { return $this->categories[$categoryUid]; - }, $fileCategoryMap[$uid]) + }, $fileCategoryMap[$uid] ?? []) ); } } diff --git a/Classes/Middleware/AssetMiddleware.php b/Classes/Middleware/AssetMiddleware.php index 71b35ed..33a4d50 100644 --- a/Classes/Middleware/AssetMiddleware.php +++ b/Classes/Middleware/AssetMiddleware.php @@ -44,11 +44,17 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface $path = $routing->getUri()->getPath(); $queryParams = $request->getQueryParams(); $uid = $queryParams['uid'] ?? null; + $uidLocal = $queryParams['uidLocal'] ?? null; if ( $path === '/asset' && - $uid + ( + $uid || + $uidLocal + ) ) { - $resource = $this->resourceFactory->getFileReferenceObject($uid); + $resource = $uid + ? $this->resourceFactory->getFileReferenceObject($uid) + : $this->resourceFactory->getFileObject($uidLocal); $tstamp = intval($resource->getProperty('tstamp')); $lastModified = gmdate('D, d M Y H:i:s', $tstamp) . ' GMT'; @@ -75,7 +81,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface ) { $cropVariant = $queryParams['breakpoint'] ?? 'default'; - $crop = $resource->getProperty('crop'); + $crop = $resource->getProperty('crop') ?? ''; $cropVariantCollection = CropVariantCollection::create($crop); $cropArea = $cropVariantCollection->getCropArea($cropVariant); @@ -93,7 +99,10 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface 'width' => $queryParams['width'] ?? null, ]; - $processedResource = $this->imageService->applyProcessingInstructions($resource, $processingInstructions); + $processedResource = $this->imageService->applyProcessingInstructions( + $resource, + $processingInstructions + ); } }