From f1fb1823ae14bb6396f7c195a9d96c3bfb7facd8 Mon Sep 17 00:00:00 2001 From: Spitfire Date: Tue, 10 Oct 2023 19:51:58 -0600 Subject: [PATCH 1/2] Content Pack Post bug Fix --- app/Services/Plugins/ImporterService.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/Services/Plugins/ImporterService.php b/app/Services/Plugins/ImporterService.php index ebf4cc19f4..ccdb57f2a6 100644 --- a/app/Services/Plugins/ImporterService.php +++ b/app/Services/Plugins/ImporterService.php @@ -554,9 +554,21 @@ protected function importPosts(PluginVersionEntity $entity, int $entityId) $post->marketplace_uuid = $uuid; } + $visibility = \App\Enums\Visibility::All->value; + + if (Arr::get($data, 'visibility') == 'admin') { + $visibility = \App\Enums\Visibility::Admin->value; + } elseif (Arr::get($data, 'visibility') == 'admin-self') { + $visibility = \App\Enums\Visibility::AdminSelf->value; + } elseif (Arr::get($data, 'visibility') == 'members') { + $visibility = \App\Enums\Visibility::Member->value; + } elseif (Arr::get($data, 'visibility') == 'self') { + $visibility = \App\Enums\Visibility::Self->value; + } + $post->name = Arr::get($data, 'name'); $post->entry = $this->mentions(Arr::get($data, 'entry')); - $post->visibility = Arr::get($data, 'visibility'); + $post->visibility_id = $visibility; $post->save(); } } From 5ebb9c0b71acc001baf57f63c8500695830447d4 Mon Sep 17 00:00:00 2001 From: Spitfire Date: Tue, 10 Oct 2023 20:08:23 -0600 Subject: [PATCH 2/2] PHP STAN FIX --- app/Services/Plugins/ImporterService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/Plugins/ImporterService.php b/app/Services/Plugins/ImporterService.php index ccdb57f2a6..af79f17638 100644 --- a/app/Services/Plugins/ImporterService.php +++ b/app/Services/Plugins/ImporterService.php @@ -369,7 +369,7 @@ protected function saveQuestElement(array $data, string $uuid, int $questId, Plu } $element->role = Arr::get($data, 'role', null); $element->description = $this->mentions(Arr::get($data, 'description', '')); - $element->visibility = 'all'; + $element->visibility_id = \App\Enums\Visibility::All->value; //dd($element); $element->save(); } catch (Exception $e) {