From: Vincent Vanwaelscappel Date: Wed, 19 Jul 2023 15:08:22 +0000 (+0200) Subject: wait #6146 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=2fa0732abdec47737b6f2bd1141d0fa6c3a4e3de;p=fluidbook-toolbox.git wait #6146 @0.5 --- diff --git a/app/Fluidbook/Link/LinksData.php b/app/Fluidbook/Link/LinksData.php index 31afdb7eb..aa869cc04 100644 --- a/app/Fluidbook/Link/LinksData.php +++ b/app/Fluidbook/Link/LinksData.php @@ -180,7 +180,7 @@ class LinksData $meta = array_merge(['version' => 2, 'onepage' => false], self::_decodegzfile($metafile)); /** @var FluidbookPublication $fluidbook */ - $fluidbook = FluidbookPublication::find($book_id); + $fluidbook = FluidbookPublication::withoutGlobalScopes()->find($book_id); if ($fluidbook->isOnePage() && !$meta['onepage']) { self::_moveToOnePageLinks($r['links'], $r['rulers'], $fluidbook); } @@ -485,7 +485,7 @@ class LinksData public static function saveLinksInFile($book_id, $user_id, $comments, $links, $rulers = [], $specialLinks = [], $specialRulers = []) { /** @var FluidbookPublication $fluidbook */ - $fluidbook = FluidbookPublication::find($book_id); + $fluidbook = FluidbookPublication::withoutGlobalScopes()->find($book_id); $lr = self::mergeLinksAndRulers($links, $rulers, $specialLinks, $specialRulers); @@ -594,7 +594,7 @@ class LinksData public static function addLinksFromPDF($book_id) { /** @var FluidbookPublication $book */ - $book = FluidbookPublication::find($book_id); + $book = FluidbookPublication::withoutGlobalScopes()->find($book_id); $booleans = array('video_loop', 'video_auto_start', 'video_controls', 'video_sound_on'); $numbers = ['left', 'top', 'width', 'height']; diff --git a/app/Http/Controllers/Admin/Operations/FluidbookPublication/PreviewOperation.php b/app/Http/Controllers/Admin/Operations/FluidbookPublication/PreviewOperation.php index 212b72be6..6c1d8cee9 100644 --- a/app/Http/Controllers/Admin/Operations/FluidbookPublication/PreviewOperation.php +++ b/app/Http/Controllers/Admin/Operations/FluidbookPublication/PreviewOperation.php @@ -61,7 +61,7 @@ trait PreviewOperation return $check; } - if (null === $time || ((null === $path || $path === 'index.html') && $time>0 && $time < (time() - 60) && !$nointerface && !$shortLoading)) { + if (null === $time || ((null === $path || $path === 'index.html') && $time > 0 && $time < (time() - 60) && !$nointerface && !$shortLoading)) { $v = ($version === 'online') ? '' : $version . '/'; $url = backpack_url($segment . '/preview/' . $v . $id . '_' . $hash . '_' . time()) . '/' . $q; return $this->loadingCompile($url, $id, $hash); @@ -83,7 +83,7 @@ trait PreviewOperation return redirect($fluidbook->redirectDemo); } if ($fluidbook->disableDemo) { - abort(404); + abort(404, __('Le lien de prévisualisation est désactivé')); } return true; } @@ -150,9 +150,9 @@ trait PreviewOperation $id = $ee[0]; } - $fluidbook = FluidbookPublication::where('id', $id)->where('hash', $hash)->first(); + $fluidbook = FluidbookPublication::withoutGlobalScopes()->where('id', $id)->where('hash', $hash)->first(); if (null === $fluidbook) { - abort(404); + abort(404, __('Lien de prévisualisation invalide')); } if (!isset($theme)) { $theme = $fluidbook->getTheme(); diff --git a/app/Jobs/FluidbookImagesPreprocess.php b/app/Jobs/FluidbookImagesPreprocess.php index bec2c6fbd..cc2d066a6 100644 --- a/app/Jobs/FluidbookImagesPreprocess.php +++ b/app/Jobs/FluidbookImagesPreprocess.php @@ -36,7 +36,7 @@ class FluidbookImagesPreprocess extends Base public function handle() { - $this->book = FluidbookPublication::find($this->book_id); + $this->book = FluidbookPublication::withoutGlobalScopes()->find($this->book_id); $settings = $this->book->getSettings(); $resolutions = Compiler::getBookResolutions($this->book); $rasterizePages = ArrayUtil::parseRange($settings->rasterizePages);