From 194a5c1a2cf43960bd82500323ec47d3dc23c753 Mon Sep 17 00:00:00 2001 From: evarisk-micka Date: Thu, 12 Oct 2023 11:48:53 +0200 Subject: [PATCH] #3382 [SQL] fix: handle database rename --- core/modules/modDigiriskDolibarr.class.php | 7 +++---- sql/update.sql | 4 ++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/modules/modDigiriskDolibarr.class.php b/core/modules/modDigiriskDolibarr.class.php index 7a765bba0..95aa6e6d2 100644 --- a/core/modules/modDigiriskDolibarr.class.php +++ b/core/modules/modDigiriskDolibarr.class.php @@ -2180,15 +2180,14 @@ public function init($options = '') $documentsPath = DOL_DATA_ROOT . ($conf->entity > 1 ? '/' . $conf->entity : ''); $mediaPath = $documentsPath . '/digiriskdolibarr'; - $ecmPath = $documentsPath . '/ecm/digiriskdolibarr'; if (is_dir($mediaPath . '/accident_investigation')) { chmod($mediaPath . '/accident_investigation', 0755); rename($mediaPath . '/accident_investigation', $mediaPath . '/accidentinvestigation'); } - if (is_dir($ecmPath . '/accident_investigationdocument')) { - chmod($ecmPath . '/accident_investigationdocument', 0755); - rename($ecmPath . '/accident_investigationdocument', $ecmPath . '/accidentinvestigationdocument'); + if (is_dir($mediaPath . '/accident_investigationdocument')) { + chmod($mediaPath . '/accident_investigationdocument', 0755); + rename($mediaPath . '/accident_investigationdocument', $mediaPath . '/accidentinvestigationdocument'); } return $this->_init($sql, $options); diff --git a/sql/update.sql b/sql/update.sql index 5663eb7dc..a390f0c91 100644 --- a/sql/update.sql +++ b/sql/update.sql @@ -227,3 +227,7 @@ DELETE FROM llx_c_digiriskdolibarr_action_trigger WHERE ref = 'ACCIDENT_INVESTIG UPDATE `llx_const` SET `value` = 'mod_accidentinvestigation_standard' WHERE `llx_const`.`name` = 'DIGIRISKDOLIBARR_ACCIDENTINVESTIGATION_ADDON'; UPDATE `llx_const` SET `value` = 'mod_accidentinvestigationdocument_standard' WHERE `llx_const`.`name` = 'DIGIRISKDOLIBARR_ACCIDENTINVESTIGATIONDOCUMENT_ADDON'; +INSERT INTO llx_c_accidentinvestigation_attendants_role SELECT * FROM llx_c_accident_investigation_attendants_role; +INSERT INTO llx_categorie_accidentinvestigation SELECT * FROM llx_categorie_accident_investigation; +DROP TABLE llx_c_accident_investigation_attendants_role; +DROP TABLE llx_categorie_accident_investigation;