From: Vincent Vanwaelscappel Date: Tue, 25 Jan 2022 12:32:33 +0000 (+0100) Subject: wip #5053 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=66d6f99bd1c7e0630f9d836443c3284169d9d757;p=odl.git wip #5053 @0.25 --- diff --git a/app/Jobs/ProcessFluidbook.php b/app/Jobs/ProcessFluidbook.php index 083351e..3cc8de8 100644 --- a/app/Jobs/ProcessFluidbook.php +++ b/app/Jobs/ProcessFluidbook.php @@ -95,7 +95,7 @@ class ProcessFluidbook extends Compiler throw new \Exception('L\'élement ' . $id . ' n\'existe pas dans la médiathèque'); } $collection = $asset->getMediaInField($asset->getAttributeValue('file_upload')); - if ((is_array($collection) && count($collection) === 0) || $collection->count() === 0) { + if ((is_array($collection) && count($collection) === 0) || $collection->count() === 0 || $asset->getFilesize() === 0) { throw new \Exception('L\'élement ' . $id . ' de la médiathèque ne contient aucun fichier'); } return $collection; @@ -114,7 +114,9 @@ class ProcessFluidbook extends Compiler $path = $item->getPath(); /** @var $item Media */ $dest = $tmp . '/' . Files::getFilename($path); - copy($path, $dest); + if (file_exists($path)) { + copy($path, $dest); + } } Zip::archive($tmp, $zip); if (!file_exists($zip)) {