Fixes #6037 -- Fix upload of Custom Browser Icon

This commit is contained in:
Buster Neece 2023-01-21 23:35:21 -06:00
parent b73b5e10bf
commit 9b0a0b159f
No known key found for this signature in database
GPG Key ID: F1D2E64A0005E80E
4 changed files with 5 additions and 3 deletions

View File

@ -83,6 +83,6 @@ abstract class AbstractCustomAsset implements CustomAssetInterface
protected function ensureDirectoryExists(string $path): void
{
(new Filesystem())->mkdir(dirname($path));
(new Filesystem())->mkdir($path);
}
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);