From: Vincent Vanwaelscappel Date: Thu, 17 Aug 2023 12:08:42 +0000 (+0200) Subject: wait #6198 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=149bcd9dae5fc8380b39a52c3e7a8edd3e4f4462;p=fluidbook-toolbox.git wait #6198 @0.5 --- diff --git a/app/Models/FluidbookPublication.php b/app/Models/FluidbookPublication.php index d928c89d1..6885996fa 100644 --- a/app/Models/FluidbookPublication.php +++ b/app/Models/FluidbookPublication.php @@ -341,6 +341,9 @@ class FluidbookPublication extends ToolboxSettingsModel /** @var Company $company */ if (null !== $owner) { $company = Company::withoutGlobalScopes()->find($owner->company); + if (null === $company) { + throw new \Exception('User ' . $this->owner . ' should be assign to a company'); + } $this->admin = $company->admin; $this->super_admin = ''; @@ -975,9 +978,9 @@ class FluidbookPublication extends ToolboxSettingsModel if ($mobileFirst) { if ($sync) { - (new GenerateDeliveryThumbnailsPreview($mobileFirst, 'mobile'))->handle(); + (new GenerateDeliveryThumbnailsPreview($mobileFirst, 'mobile'))->handle(); } else { - dispatch(new GenerateDeliveryThumbnailsPreview($mobileFirst, 'mobile'))->onQueue('theme'); + dispatch(new GenerateDeliveryThumbnailsPreview($mobileFirst, 'mobile'))->onQueue('theme'); } } @@ -985,8 +988,8 @@ class FluidbookPublication extends ToolboxSettingsModel (new GenerateDeliveryThumbnailsPreview($this))->handle(); (new GenerateDeliveryThumbnailsPreview($this, 'mobile'))->handle(); } else { - dispatch(new GenerateDeliveryThumbnailsPreview($this, ))->onQueue('theme'); - dispatch(new GenerateDeliveryThumbnailsPreview($this, 'mobile'))->onQueue('theme'); + dispatch(new GenerateDeliveryThumbnailsPreview($this,))->onQueue('theme'); + dispatch(new GenerateDeliveryThumbnailsPreview($this, 'mobile'))->onQueue('theme'); } }