Fixes #6037 -- Fix upload of Custom Browser Icon
This commit is contained in:
parent
b73b5e10bf
commit
9b0a0b159f
|
@ -83,6 +83,6 @@ abstract class AbstractCustomAsset implements CustomAssetInterface
|
|||
|
||||
protected function ensureDirectoryExists(string $path): void
|
||||
{
|
||||
(new Filesystem())->mkdir(dirname($path));
|
||||
(new Filesystem())->mkdir($path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ final class AlbumArtCustomAsset extends AbstractMultiPatternCustomAsset
|
|||
$pattern = $patterns[$mimeType] ?? $patterns['default'];
|
||||
|
||||
$destPath = $this->getPathForPattern($pattern);
|
||||
$this->ensureDirectoryExists($destPath);
|
||||
$this->ensureDirectoryExists(dirname($destPath));
|
||||
|
||||
$newImage->save($destPath, 90);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ final class BackgroundCustomAsset extends AbstractMultiPatternCustomAsset
|
|||
$pattern = $patterns[$mimeType] ?? $patterns['default'];
|
||||
|
||||
$destPath = $this->getPathForPattern($pattern);
|
||||
$this->ensureDirectoryExists($destPath);
|
||||
$this->ensureDirectoryExists(dirname($destPath));
|
||||
|
||||
$newImage->save($destPath, 90);
|
||||
}
|
||||
|
|
|
@ -40,6 +40,8 @@ final class BrowserIconCustomAsset extends AbstractCustomAsset
|
|||
|
||||
public function upload(Image $image): void
|
||||
{
|
||||
$this->delete();
|
||||
|
||||
$uploadsDir = $this->environment->getUploadsDirectory() . '/browser_icon';
|
||||
$this->ensureDirectoryExists($uploadsDir);
|
||||
|
||||
|
|
Loading…
Reference in New Issue