|
|
@@ -96,7 +96,7 @@ class LocalStorage implements FileStorageInterface
|
|
|
public function getImageUrl(File $file, string $size, bool $relativePath): string
|
|
|
{
|
|
|
$filterName = $this->getFilterFromSizeAndConfig($size, !empty($file->getConfig()));
|
|
|
- $path = $file->getPath();
|
|
|
+ $path = $file->getSlug();
|
|
|
|
|
|
if (!$this->cacheManager->isStored($path, $filterName)) {
|
|
|
try {
|
|
|
@@ -191,7 +191,12 @@ class LocalStorage implements FileStorageInterface
|
|
|
throw new \RuntimeException('File has no filename');
|
|
|
}
|
|
|
|
|
|
- $isNewFile = $file->getSlug() === null;
|
|
|
+ try {
|
|
|
+ $isNewFile = $file->getSlug() === null;
|
|
|
+ } catch (\Throwable) {
|
|
|
+ $isNewFile = true; // Catch case where slud has not been initialized
|
|
|
+ }
|
|
|
+
|
|
|
if ($isNewFile) {
|
|
|
// Try to get the Access owner from the organization_id and person_id
|
|
|
$access = null;
|