From: Vincent Vanwaelscappel Date: Wed, 22 Nov 2023 07:24:21 +0000 (+0100) Subject: wait #6502 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=dad579acbd2f10f3b3d06649ad0300dc1dd2c910;p=fluidbook-toolbox.git wait #6502 @0.25 --- diff --git a/app/Models/FluidbookDocument.php b/app/Models/FluidbookDocument.php index a42932bdf..abbb5ea4a 100644 --- a/app/Models/FluidbookDocument.php +++ b/app/Models/FluidbookDocument.php @@ -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()); }