]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6146 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 19 Jul 2023 15:08:22 +0000 (17:08 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 19 Jul 2023 15:08:22 +0000 (17:08 +0200)
app/Fluidbook/Link/LinksData.php
app/Http/Controllers/Admin/Operations/FluidbookPublication/PreviewOperation.php
app/Jobs/FluidbookImagesPreprocess.php

index 31afdb7eb85066aa1ab8415207c4469a85864d03..aa869cc041ee729807a5ea0973fbbd66fd1f1855 100644 (file)
@@ -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'];
index 212b72be62603e9c81114eb089371fae9f3692e7..6c1d8cee9111a2c2537b0f31932c3b56c0b472e8 100644 (file)
@@ -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();
index bec2c6fbdc5c91fdd8bca9888041bdaf36e1117d..cc2d066a6c36586ece87e6f12e8fb7df9d6b46fc 100644 (file)
@@ -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);