From 13231375f17a5b0e1a2fd275fd824eb00011aae4 Mon Sep 17 00:00:00 2001 From: Esteban Gallego Date: Wed, 31 Jan 2024 17:09:56 -0500 Subject: [PATCH 1/4] Remove check of the Screen Interstitial when importing assets --- ProcessMaker/Http/Controllers/Api/TemplateController.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ProcessMaker/Http/Controllers/Api/TemplateController.php b/ProcessMaker/Http/Controllers/Api/TemplateController.php index 7134d136fd..0f02143220 100644 --- a/ProcessMaker/Http/Controllers/Api/TemplateController.php +++ b/ProcessMaker/Http/Controllers/Api/TemplateController.php @@ -215,13 +215,6 @@ private function checkIfAssetsExist($request) $existingOptions = []; foreach ($payload['export'] as $key => $asset) { - if (Str::contains($asset['name'], 'Screen Interstitial') - || Str::contains($asset['model'], 'CommentConfiguration') - ) { - unset($payload['export'][$key]); - continue; - } - if (!$asset['model']::where('uuid', $key)->exists() || $payload['root'] === $asset['attributes']['uuid'] || Str::contains($asset['type'], 'Category') From ec9ee6af5caf1195bd437f4d22736e212b6d86ea Mon Sep 17 00:00:00 2001 From: Esteban Gallego Date: Thu, 1 Feb 2024 11:03:34 -0500 Subject: [PATCH 2/4] unset CommentConfiguration when checking for duplicate asset --- ProcessMaker/Http/Controllers/Api/TemplateController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ProcessMaker/Http/Controllers/Api/TemplateController.php b/ProcessMaker/Http/Controllers/Api/TemplateController.php index 0f02143220..9c1e154cda 100644 --- a/ProcessMaker/Http/Controllers/Api/TemplateController.php +++ b/ProcessMaker/Http/Controllers/Api/TemplateController.php @@ -215,6 +215,12 @@ private function checkIfAssetsExist($request) $existingOptions = []; foreach ($payload['export'] as $key => $asset) { + if (Str::contains($asset['model'], 'CommentConfiguration') + ) { + unset($payload['export'][$key]); + continue; + } + if (!$asset['model']::where('uuid', $key)->exists() || $payload['root'] === $asset['attributes']['uuid'] || Str::contains($asset['type'], 'Category') From 70b0e2d1411e742c80e3627fcfbd60a686eb794f Mon Sep 17 00:00:00 2001 From: Esteban Gallego Date: Thu, 1 Feb 2024 11:59:50 -0500 Subject: [PATCH 3/4] Revert "unset CommentConfiguration when checking for duplicate asset" This reverts commit ec9ee6af5caf1195bd437f4d22736e212b6d86ea. --- ProcessMaker/Http/Controllers/Api/TemplateController.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ProcessMaker/Http/Controllers/Api/TemplateController.php b/ProcessMaker/Http/Controllers/Api/TemplateController.php index 9c1e154cda..0f02143220 100644 --- a/ProcessMaker/Http/Controllers/Api/TemplateController.php +++ b/ProcessMaker/Http/Controllers/Api/TemplateController.php @@ -215,12 +215,6 @@ private function checkIfAssetsExist($request) $existingOptions = []; foreach ($payload['export'] as $key => $asset) { - if (Str::contains($asset['model'], 'CommentConfiguration') - ) { - unset($payload['export'][$key]); - continue; - } - if (!$asset['model']::where('uuid', $key)->exists() || $payload['root'] === $asset['attributes']['uuid'] || Str::contains($asset['type'], 'Category') From 58a9b265af679274bd4f6e072c2dd719f2498aca Mon Sep 17 00:00:00 2001 From: Esteban Gallego Date: Thu, 1 Feb 2024 14:36:34 -0500 Subject: [PATCH 4/4] Add back CommentConfiguration to the checkIfAssetsExist --- ProcessMaker/Http/Controllers/Api/TemplateController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ProcessMaker/Http/Controllers/Api/TemplateController.php b/ProcessMaker/Http/Controllers/Api/TemplateController.php index 3306af5fd8..86d393a10c 100644 --- a/ProcessMaker/Http/Controllers/Api/TemplateController.php +++ b/ProcessMaker/Http/Controllers/Api/TemplateController.php @@ -223,6 +223,12 @@ private function checkIfAssetsExist($request) $existingOptions = []; foreach ($payload['export'] as $key => $asset) { + if (Str::contains($asset['model'], 'CommentConfiguration') + ) { + unset($payload['export'][$key]); + continue; + } + if (!$asset['model']::where('uuid', $key)->exists() || $payload['root'] === $asset['attributes']['uuid'] || Str::contains($asset['type'], 'Category')