]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6486 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 16 Nov 2023 18:41:50 +0000 (19:41 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 16 Nov 2023 18:41:50 +0000 (19:41 +0100)
app/Models/FluidbookPublication.php

index 317425812d77422eea8c630de83fc15d3de774c0..8b3847e84e9bdd7272a3e551d4d377d7c53d6d0a 100644 (file)
@@ -283,20 +283,6 @@ class FluidbookPublication extends ToolboxSettingsModel
         return parent::setAttribute($key, $value);
     }
 
-    public function onRetrieved(): bool
-    {
-        $res = parent::onRetrieved();
-        $fields = ['imageFormat', 'secureClientSidePassword', 'relay_url_params'];
-        foreach ($fields as $n) {
-            $f = $this->getField($n);
-            if (!isset($this->{$n}) || null === $this->{$n}) {
-                $this->{$n} = $f->getAttribute('default');
-            }
-        }
-
-        return $res;
-    }
-
     public function onSaving(): bool
     {
         $this->setComposedAttributes();
@@ -1025,12 +1011,18 @@ class FluidbookPublication extends ToolboxSettingsModel
             $version = 3;
         }
         $this->version = $version;
+        $fields = ['imageFormat', 'secureClientSidePassword', 'relay_url_params'];
+        foreach ($fields as $n) {
+            $f = $this->getField($n);
+            if (null === $this->{$n}) {
+                $this->{$n} = $f->getAttribute('default');
+            }
+        }
         $this->save();
 
         DB::update('UPDATE ' . WorkshopMigration::OLD_DB . '.books SET version=' . $version . ' WHERE book_id=' . $this->id);
     }
 
-
     public function generateThumbnailsPreview($sync = false)
     {
         $mobilefirstFluidbookId = $this->mobilefirstFluidbookId;