From 28f90a14fd75e8a913c0030b4cc78452f7c93652 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 28 Apr 2023 19:19:54 +0200 Subject: [PATCH] wait #5898 @0.5 --- app/Fluidbook/Compiler.php | 1 + app/Jobs/Maintenance/CheckPublicationsHashAndCid.php | 2 +- app/Models/FluidbookPublication.php | 7 ++++++- resources/views/columns/owner.blade.php | 5 +++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/Fluidbook/Compiler.php b/app/Fluidbook/Compiler.php index 8cf4d2016..5461ab701 100644 --- a/app/Fluidbook/Compiler.php +++ b/app/Fluidbook/Compiler.php @@ -2882,6 +2882,7 @@ height="0" width="0" style="display:none;visibility:hidden"> } } $data['id'] = $this->book_id; + $data['compiler'] = 3; return 'var SETTINGS=' . json_encode($data) . ';' . "\n"; } diff --git a/app/Jobs/Maintenance/CheckPublicationsHashAndCid.php b/app/Jobs/Maintenance/CheckPublicationsHashAndCid.php index 5ddce2da2..c04982d6f 100644 --- a/app/Jobs/Maintenance/CheckPublicationsHashAndCid.php +++ b/app/Jobs/Maintenance/CheckPublicationsHashAndCid.php @@ -11,7 +11,7 @@ class CheckPublicationsHashAndCid extends Base public function handle() { /** @var FluidbookPublication $fluidbook */ - foreach (FluidbookPublication::withoutGlobalScopes()->whereNull('hash')->orWhere('hash', '')->orWhereNull('cid')->orWhere('cid', '')->get() as $fluidbook) { + foreach (FluidbookPublication::withoutGlobalScopes()->where('created_ok', '1')->whereNull('hash')->orWhere('hash', '')->orWhereNull('cid')->orWhere('cid', '')->get() as $fluidbook) { $fluidbook->save(); echo 'Process ' . $fluidbook->id . "\n"; } diff --git a/app/Models/FluidbookPublication.php b/app/Models/FluidbookPublication.php index 995823380..9e0d41ca3 100644 --- a/app/Models/FluidbookPublication.php +++ b/app/Models/FluidbookPublication.php @@ -275,7 +275,12 @@ class FluidbookPublication extends ToolboxSettingsModel $this->extranet_project = ''; $this->c_title = $this->title; - $this->c_pages = count($this->composition); + if (null !== $this->composition) { + $this->c_pages = count($this->composition); + } else { + Log::warning('Fluidbook ' . $this->id . ' has empty composition'); + } + } public function __($str) diff --git a/resources/views/columns/owner.blade.php b/resources/views/columns/owner.blade.php index c64660cad..6903d6809 100644 --- a/resources/views/columns/owner.blade.php +++ b/resources/views/columns/owner.blade.php @@ -48,7 +48,7 @@ }).then((result) => { if (result.isConfirmed) { let select = $(Swal.getHtmlContainer()).find('select'); - window.location = '{{backpack_url($entry->getOption('name').'/'.$entry->id.'/changeowner')}}/' + select.val(); + window.location = '{{backpack_url($entry->getOption('name'))}}/' + $(a).data('entry-id') + '/changeowner/' + select.val(); } }); return false; @@ -68,5 +68,6 @@ - {!! $v !!} + {!! $v !!} -- 2.39.5