Method getPhoto of Photo model should return false on error

Instead of red circle image, which breaks proxy module
This commit is contained in:
fabrixxm 2018-12-14 08:31:08 +01:00 committed by Hypolite Petovan
parent 4e38bc8a0d
commit bbbc15a5eb
2 changed files with 4 additions and 3 deletions

View file

@ -138,9 +138,7 @@ class Photo extends BaseObject
$params = ["order" => ["scale" => true]]; $params = ["order" => ["scale" => true]];
$photo = self::selectFirst([], $conditions, $params); $photo = self::selectFirst([], $conditions, $params);
if ($photo === false) {
return self::createPhotoForSystemResource("images/nosign.jpg");
}
return $photo; return $photo;
} }

View file

@ -69,6 +69,9 @@ class Photo extends BaseModule
$photoid = substr($photoid, 0, -2); $photoid = substr($photoid, 0, -2);
} }
$photo = MPhoto::getPhoto($photoid, $scale); $photo = MPhoto::getPhoto($photoid, $scale);
if ($photo === false) {
$photo = MPhoto::createPhotoForSystemResource("images/nosign.jpg");
}
break; break;
} }