From dad579acbd2f10f3b3d06649ad0300dc1dd2c910 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 22 Nov 2023 08:24:21 +0100 Subject: [PATCH] wait #6502 @0.25 --- app/Models/FluidbookDocument.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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()); } -- 2.39.5