Browse Source

Method getPhoto of Photo model should return false on error

Instead of red circle image, which breaks proxy module
pull/6482/head
fabrixxm 2 years ago
committed by Hypolite Petovan
parent
commit
bbbc15a5eb
2 changed files with 4 additions and 3 deletions
  1. +1
    -3
      src/Model/Photo.php
  2. +3
    -0
      src/Module/Photo.php

+ 1
- 3
src/Model/Photo.php View File

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


+ 3
- 0
src/Module/Photo.php View File

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


Loading…
Cancel
Save