From d29ec1ae43c9fb5bba89fa6e2636ff0d026ee9b5 Mon Sep 17 00:00:00 2001
From: Damien <damien.burel@maarch.org>
Date: Mon, 20 Jul 2020 10:01:18 +0200
Subject: [PATCH] FEAT #14469 TIME 0:20 Fix migrate working days

---
 migration/20.03/migrateWorkingDays.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/migration/20.03/migrateWorkingDays.php b/migration/20.03/migrateWorkingDays.php
index ca495db87a8..770a80f515e 100644
--- a/migration/20.03/migrateWorkingDays.php
+++ b/migration/20.03/migrateWorkingDays.php
@@ -14,7 +14,7 @@ foreach ($customs as $custom) {
     $workingDays = 1;
     $xmlfile = null;
     $path = "custom/{$custom}/apps/maarch_entreprise/xml/features.xml";
-    if (file_exists($path)) {
+    if (is_file($path)) {
         $xmlfile = simplexml_load_file($path);
 
         if ($xmlfile) {
@@ -36,6 +36,9 @@ foreach ($customs as $custom) {
         }
     }
 
+    \SrcCore\models\DatabasePDO::reset();
+    new \SrcCore\models\DatabasePDO(['customId' => $custom]);
+
     \Parameter\models\ParameterModel::delete(['id' => 'workingDays']);
     \Parameter\models\ParameterModel::create([
         'id'              => 'workingDays',
-- 
GitLab