From bdc08ea94a3e62fd10d1bf77e5bbdfa9ef3343ca Mon Sep 17 00:00:00 2001
From: "florian.azizian" <florian.azizian@maarch.org>
Date: Wed, 29 Jan 2020 18:21:28 +0100
Subject: [PATCH] FEAT #12167 TIME 0:10 control file creation in migrate
 template

---
 migration/20.03/migrateTemplates.php | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/migration/20.03/migrateTemplates.php b/migration/20.03/migrateTemplates.php
index f7a770c1af1..c9ea4e7d194 100644
--- a/migration/20.03/migrateTemplates.php
+++ b/migration/20.03/migrateTemplates.php
@@ -259,11 +259,16 @@ foreach ($customs as $custom) {
                 $resource = file_get_contents($pathFilename);
                 $pathInfo = pathinfo($pathFilename);
                 $storeResult = DocserverController::storeResourceOnDocServer([
-                        'collId'            => 'templates',
-                        'docserverTypeId'   => 'TEMPLATES',
-                        'encodedResource'   => base64_encode($resource),
-                        'format'            => $pathInfo['extension']
-                    ]);
+                    'collId'           => 'templates',
+                    'docserverTypeId'  => 'TEMPLATES',
+                    'encodedResource'  => base64_encode($resource),
+                    'format'           => $pathInfo['extension']
+                ]);
+
+                if (!empty($storeResult['errors'])) {
+                    echo $storeResult['errors'];
+                    continue;
+                }
 
                 TemplateModel::update([
                         'set'   => [
-- 
GitLab