Skip to content

Commit 6b6c479

Browse files
committed
#AC-10721::Investigate the league/flysystem Composer dependencies upgrading to latest version- implementation changes
1 parent e71c3c9 commit 6b6c479

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

app/code/Magento/AwsS3/Test/Mftf/Helper/S3FileAssertions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public function assertDirectoryExists($path, $message = ''): void
213213
*/
214214
public function assertDirectoryDoesNotExist($path, $message = ''): void
215215
{
216-
$this->assertFalse($this->driver->isDirectory($path), "Failed asserting $path does not exist. " . $message);
216+
$this->assertFalse($this->driver->isDirectoryExists($path), "Failed asserting $path does not exist. " . $message);
217217
}
218218

219219
/**

app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3MediaGalleryDeleteFolderTest.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616
<description value="Verify that when a user deletes a folder in Media Gallery that the directory gets
1717
deleted in S3 and in the local file system."/>
1818
<severity value="CRITICAL"/>
19-
<skip>
20-
<issueId value="AC-11388">Excluding to make s3 backward compatible with flysystem lib</issueId>
21-
</skip>
2219
<group value="remote_storage_aws_s3_media_gallery_ui"/>
23-
<group value="pr_exclude"/>
2420
</annotations>
2521

2622
<before>

app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3MediaGalleryDeleteImageTest.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616
<description value="Verify that when a user deletes an image in Media Gallery that the image gets deleted
1717
in S3 and in the local file system."/>
1818
<severity value="CRITICAL"/>
19-
<skip>
20-
<issueId value="AC-11388">Excluding to make s3 backward compatible with flysystem lib</issueId>
21-
</skip>
2219
<group value="remote_storage_aws_s3_media_gallery_ui"/>
23-
<group value="pr_exclude"/>
2420
</annotations>
2521

2622
<before>

app/code/Magento/RemoteStorage/Driver/Adapter/CachedAdapter.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,16 @@ public function directoryExists(string $path): bool
177177

178178
$exists = $this->adapter->directoryExists($path);
179179

180+
if (!$exists) {
181+
try {
182+
// check if target is a directory
183+
$exists = iterator_count($this->adapter->listContents($path, false)) > 0;
184+
} catch (\Throwable $e) {
185+
// catch closed iterator
186+
$exists = false;
187+
}
188+
}
189+
180190
if ($exists) {
181191
$cacheEntry = ['type' => 'dir', 'path' => $path];
182192
$this->cache->updateMetadata($path, $cacheEntry, true);

0 commit comments

Comments
 (0)