diff --git a/ProcessMaker/Templates/ProcessTemplate.php b/ProcessMaker/Templates/ProcessTemplate.php index 2ce246c08b..6f9c61e957 100644 --- a/ProcessMaker/Templates/ProcessTemplate.php +++ b/ProcessMaker/Templates/ProcessTemplate.php @@ -229,6 +229,15 @@ public function create($request) : JsonResponse continue; } + // Exclude the import of process categories if the category already exists in the database + if ($asset['model'] === 'ProcessMaker\Models\ProcessCategory') { + $processCategory = ProcessCategory::where('uuid', $key)->first(); + if ($processCategory !== null) { + unset($payload['export'][$key]); + continue; + } + } + $postOptions[$key] = [ 'mode' => 'copy', 'isTemplate' => false,