Skip to content

Commit e7daa20

Browse files
Updates for directory permission
1 parent a9808ea commit e7daa20

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

MediaGalleryRenditions/Model/GenerateRenditions.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class GenerateRenditions implements GenerateRenditionsInterface
3737
* @var CreateAssetFromFile
3838
*/
3939
private $createAssetFromFile;
40+
4041
/**
4142
* @var Filesystem
4243
*/
@@ -77,7 +78,9 @@ public function execute(array $assets): void
7778
continue;
7879
}
7980
$renditionDirectoryPath = $this->getRenditionPath->execute($asset);
80-
$renditionImagePath = $renditionDirectoryPath . $asset->getPath();
81+
$this->filesystem->getDirectoryWrite(DirectoryList::MEDIA)
82+
->create($renditionDirectoryPath);
83+
$renditionImagePath = $renditionDirectoryPath . '/' . $asset->getPath();
8184
$image = $this->imageFactory->create();
8285
$image->open($path);
8386
$image->keepAspectRatio(true);

MediaGalleryRenditions/Model/GetRenditionPath.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(
3939
Filesystem $filesystem,
4040
DriverInterface $file = null
4141
) {
42-
$this->directory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
42+
$this->directory = $filesystem->getDirectoryRead(DirectoryList::MEDIA);
4343
$this->file = $file ?: ObjectManager::getInstance()->get(Filesystem\Driver\File::class);
4444
}
4545

0 commit comments

Comments
 (0)