Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Classes/Resource/RemoteResourceCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -43,6 +44,7 @@ class RemoteResourceCollection implements LoggerAwareInterface
protected readonly array $resources;

protected readonly ResourceFactory $resourceFactory;
protected readonly StorageRepository $storageRepository;

/**
* @var FileInterface[]
Expand All @@ -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);
}

/**
Expand Down Expand Up @@ -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);
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
array (
'depends' =>
array (
'typo3' => '13.4.0-13.4.99',
'typo3' => '13.4.0-14.2.99',
),
'conflicts' =>
array (
Expand Down
Loading