Skip to content

Commit 0d5dca6

Browse files
committed
Fixed #16690 - fallback to category image if no model image is present
Signed-off-by: snipe <[email protected]>
1 parent 0f9b711 commit 0d5dca6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/Models/Asset.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,8 @@ public function getImageUrl()
656656
return Storage::disk('public')->url(app('assets_upload_path').e($this->image));
657657
} elseif ($this->model && ! empty($this->model->image)) {
658658
return Storage::disk('public')->url(app('models_upload_path').e($this->model->image));
659+
} elseif ($this->model->category && ! empty($this->model->category->image)) {
660+
return Storage::disk('public')->url(app('categories_upload_path').e($this->model->category->image));
659661
}
660662

661663
return false;

0 commit comments

Comments
 (0)