MIRSPORTA-260 Отсутствующие картинки на 10баллов

"обход" ошибки с отсутствующим файлом изображения при попытке форсированного создания варианта
push-update
This commit is contained in:
Alexander Demidov
2014-02-18 13:29:27 +04:00
parent 9d94208dba
commit de4a3a7924
2 changed files with 44 additions and 40 deletions

View File

@ -86,7 +86,8 @@ abstract class File
* @var $this Image
*/
if (!array_key_exists($size, $this->variants)) {
if ($force_create && $this->getIsNoEmpty()) {
$original_file_path = Config::get('PATH_WEB_ROOT') . '/' . $this->getWebName();
if ($force_create && $this->getIsNoEmpty() && file_exists($original_file_path)) {
Upload::imageVariant($this, $size);
} else {
$this->variants[$size] = new ImageVariant();