]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6502 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Nov 2023 07:24:21 +0000 (08:24 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Nov 2023 07:24:21 +0000 (08:24 +0100)
app/Models/FluidbookDocument.php

index a42932bdfc138a43cdc93f5c15f30b2d6e9bb7b8..abbb5ea4a9f30420cf94fdbc8bae4f46657b9ef7 100644 (file)
@@ -216,7 +216,7 @@ class FluidbookDocument extends ToolboxModel
         }
 
         $base = 'fluidbookpublication/docs/' . $this->id . '/' . $path;
-        $res = Files::mkdir($this->region == 'UE' ? protected_path($base) : us_protected_path($base));
+        $res = Files::mkdir($this->getRegion() == 'UE' ? protected_path($base) : us_protected_path($base));
 
         if ($fname) {
             $res .= $fname;
@@ -224,6 +224,11 @@ class FluidbookDocument extends ToolboxModel
         return $res;
     }
 
+    public function getRegion()
+    {
+        return $this->region ?? 'UE';
+    }
+
     public function hasFile($page, $format = 'jpg', $resolution = 150, $quality = 85, $withText = true, $withGraphics = true, $version = 'html', $forceCheck = false)
     {
         $this->_normalize($format, $resolution, $quality, $withText, $withGraphics, $version);
@@ -344,7 +349,7 @@ class FluidbookDocument extends ToolboxModel
 
     public function _getFile($page, $format = 'jpg', $resolution = 150, $quality = 85, $withText = true, $withGraphics = true, $version = 'html', $forceCheck = true)
     {
-        Farm::setRegion($this->region);
+        Farm::setRegion($this->getRegion());
         if (!$this->hasFile($page, $format, $resolution, $quality, $withText, $withGraphics, $version, $forceCheck)) {
             return Farm::getFile($page, $format, $resolution, $quality, $withText, $withGraphics, $version, $this->getResolutionRatio(), $this->getMobileFirstRatio(), $this->path());
         }