From bbbc15a5ebd3127909e6fca0a5cc21d84f080ee1 Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Fri, 14 Dec 2018 08:31:08 +0100 Subject: [PATCH] Method getPhoto of Photo model should return false on error Instead of red circle image, which breaks proxy module --- src/Model/Photo.php | 4 +--- src/Module/Photo.php | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Model/Photo.php b/src/Model/Photo.php index fe84d08a47..88f6d4269b 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -138,9 +138,7 @@ class Photo extends BaseObject $params = ["order" => ["scale" => true]]; $photo = self::selectFirst([], $conditions, $params); - if ($photo === false) { - return self::createPhotoForSystemResource("images/nosign.jpg"); - } + return $photo; } diff --git a/src/Module/Photo.php b/src/Module/Photo.php index 3cf500719f..9277670f62 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -69,6 +69,9 @@ class Photo extends BaseModule $photoid = substr($photoid, 0, -2); } $photo = MPhoto::getPhoto($photoid, $scale); + if ($photo === false) { + $photo = MPhoto::createPhotoForSystemResource("images/nosign.jpg"); + } break; } -- 2.39.5