From 84941b6c5d477695b92b59ec62e68da87ddb3f42 Mon Sep 17 00:00:00 2001 From: Georg Ringer Date: Tue, 31 Mar 2026 09:36:15 +0200 Subject: [PATCH] [TASK] Make it compatible with v14 --- Classes/Resource/RemoteResourceCollection.php | 7 +++++-- composer.json | 2 +- ext_emconf.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Classes/Resource/RemoteResourceCollection.php b/Classes/Resource/RemoteResourceCollection.php index d8470ee..834b12e 100644 --- a/Classes/Resource/RemoteResourceCollection.php +++ b/Classes/Resource/RemoteResourceCollection.php @@ -29,6 +29,7 @@ use TYPO3\CMS\Core\Resource\ResourceFactory; use TYPO3\CMS\Core\Resource\ResourceInterface; use TYPO3\CMS\Core\Resource\ResourceStorage; +use TYPO3\CMS\Core\Resource\StorageRepository; use TYPO3\CMS\Core\Utility\GeneralUtility; class RemoteResourceCollection implements LoggerAwareInterface @@ -43,6 +44,7 @@ class RemoteResourceCollection implements LoggerAwareInterface protected readonly array $resources; protected readonly ResourceFactory $resourceFactory; + protected readonly StorageRepository $storageRepository; /** * @var FileInterface[] @@ -61,6 +63,7 @@ public function __construct(array $resources, ?ResourceFactory $resourceFactory $this->resources = $resources; $this->resourceFactory = $resourceFactory ?: GeneralUtility::makeInstance(ResourceFactory::class); $this->fileRepository = $fileRepository ?: GeneralUtility::makeInstance(FileRepository::class); + $this->storageRepository = GeneralUtility::makeInstance(StorageRepository::class); } /** @@ -143,7 +146,7 @@ protected function fileCanBeReProcessed($fileIdentifier, $filePath): bool if (!array_key_exists($filePath, static::$fileIdentifierCache)) { static::$fileIdentifierCache[$filePath] = null; $localPath = $filePath; - $storage = $this->resourceFactory->getStorageObject(0, [], $localPath); + $storage = $this->storageRepository->getStorageObject(0, [], $localPath); if ($storage->getUid() !== 0) { static::$fileIdentifierCache[$filePath] = $this->getFileObjectFromStorage($storage, $fileIdentifier); } @@ -162,7 +165,7 @@ protected function getFileObjectFromStorage(ResourceStorage $storage, string $fi { if (!$storage->isWithinProcessingFolder($fileIdentifier)) { try { - $fileObject = $this->resourceFactory->getFileObjectByStorageAndIdentifier($storage->getUid(), $fileIdentifier); + $fileObject = $storage->getFileByIdentifier($fileIdentifier); } catch (\InvalidArgumentException) { return null; } diff --git a/composer.json b/composer.json index 8d86c24..5db25d8 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ ], "require": { "php": "^8.2", - "typo3/cms-core": "^13.4" + "typo3/cms-core": "^13.4 || ^14.2" }, "require-dev": { "phpunit/phpunit": "^10.5", diff --git a/ext_emconf.php b/ext_emconf.php index d1f38b1..411ba16 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -26,7 +26,7 @@ array ( 'depends' => array ( - 'typo3' => '13.4.0-13.4.99', + 'typo3' => '13.4.0-14.2.99', ), 'conflicts' => array (