From 05996c87c8a01ed65b4c07212260f33a06a89bae Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 16 Nov 2023 15:02:51 +0100 Subject: [PATCH] wait #6474 @2 --- app/Fluidbook/Compiler/Secure.php | 2 +- app/Fluidbook/Farm.php | 4 ++-- app/Models/FluidbookPublication.php | 14 ++++++++++++++ .../fluidbook_publication/download.blade.php | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/Fluidbook/Compiler/Secure.php b/app/Fluidbook/Compiler/Secure.php index 84c079da6..44464769c 100644 --- a/app/Fluidbook/Compiler/Secure.php +++ b/app/Fluidbook/Compiler/Secure.php @@ -11,7 +11,7 @@ trait Secure protected function writeSecure() { - if (trim($this->fluidbookSettings->secureClientSidePasswordCredentials)) { + if (isset($this->fluidbookSettings->secureClientSidePasswordCredentials) && null !== $this->fluidbookSettings->secureClientSidePasswordCredentials && trim($this->fluidbookSettings->secureClientSidePasswordCredentials)) { $this->writeSecurePage(); } diff --git a/app/Fluidbook/Farm.php b/app/Fluidbook/Farm.php index f348806c7..e71026e9a 100644 --- a/app/Fluidbook/Farm.php +++ b/app/Fluidbook/Farm.php @@ -15,8 +15,8 @@ class Farm { protected static $_outPDF = []; - protected static $_forceServer = false; - //protected static $_forceServer = 'alphaville'; + //protected static $_forceServer = false; + protected static $_forceServer = 'alphaville'; protected static $_farmServers = [ ['name' => 'alphaville', 'host' => 'fluidbook-processfarm', 'port' => 9000, 'weight' => 12, 'region' => 'UE'], ['name' => 'brazil', 'host' => 'brazil.cubedesigners.com', 'weight' => 6, 'region' => 'US'], diff --git a/app/Models/FluidbookPublication.php b/app/Models/FluidbookPublication.php index 0cf8773ac..cb9b40d1b 100644 --- a/app/Models/FluidbookPublication.php +++ b/app/Models/FluidbookPublication.php @@ -279,6 +279,20 @@ class FluidbookPublication extends ToolboxSettingsModel return parent::setAttribute($key, $value); } + public function onRetrieved(): bool + { + $res = parent::onRetrieved(); + + foreach ($this->getFields() as $field) { + $n = $field->getName(); + if (!isset($this->{$n}) || null === $this->{$n}) { + $default = $field->getAttribute('default') ?? ''; + $this->{$n} = $default; + } + } + + return $res; + } public function onSaving(): bool { diff --git a/resources/views/vendor/backpack/crud/buttons/fluidbook_publication/download.blade.php b/resources/views/vendor/backpack/crud/buttons/fluidbook_publication/download.blade.php index 808d1397a..e56bab66a 100644 --- a/resources/views/vendor/backpack/crud/buttons/fluidbook_publication/download.blade.php +++ b/resources/views/vendor/backpack/crud/buttons/fluidbook_publication/download.blade.php @@ -38,7 +38,7 @@ } if(can('fluibook-publication:download:install-hosting') && ($entry->install_online || $entry->scorm_enable)){ $installActions['sep_install']='---------'; - if($entry->install_online && $entry->install_online->server && isset($servers[$entry->install_online->server])){ + if($entry->install_online && is_object($entry->install_online) && $entry->install_online->server && isset($servers[$entry->install_online->server])){ $server=$servers[$entry->install_online->server]; if($entry->install_online->path || $server['allows_root']){ $installActions['install_online']=[ -- 2.39.5