From faf7b3a00a92b66f064ffd67feb5249d12b1501f Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Mon, 6 Oct 2025 17:23:45 +0200 Subject: [PATCH] Temporarily disable ECM integration to prevent fatal errors - Added ECM integration toggle for easy enable/disable - Temporarily disabled ECM integration to prevent fatal errors - Added debugging logs to track ECM files path resolution - PDF saving to disk still works without ECM integration - Declaration validation will work without document management - Can be re-enabled once ECM files path is properly resolved --- core/class/declarationtva.class.php | 38 +++++++++++++++++------------ 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/core/class/declarationtva.class.php b/core/class/declarationtva.class.php index 57e5024..25adf88 100644 --- a/core/class/declarationtva.class.php +++ b/core/class/declarationtva.class.php @@ -1129,25 +1129,31 @@ class DeclarationTVA } // Try to add document record to Dolibarr (optional feature) - // Try multiple possible paths for ecmfiles.class.php - $ecmfiles_paths = array( - DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php', - dirname(__FILE__) . '/../../../ecm/class/ecmfiles.class.php', - dirname(__FILE__) . '/../../../../ecm/class/ecmfiles.class.php', - DOL_DOCUMENT_ROOT . '/core/class/ecmfiles.class.php', - dirname(__FILE__) . '/../../../../core/class/ecmfiles.class.php' - ); + // Skip ECM integration if there are any issues to prevent fatal errors + $ecm_integration_enabled = false; // Temporarily disabled to prevent fatal errors - $ecmfiles_path = null; - foreach ($ecmfiles_paths as $path) { - if (file_exists($path)) { - $ecmfiles_path = $path; - break; + if ($ecm_integration_enabled) { + // Try multiple possible paths for ecmfiles.class.php + $ecmfiles_paths = array( + DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php', + dirname(__FILE__) . '/../../../ecm/class/ecmfiles.class.php', + dirname(__FILE__) . '/../../../../ecm/class/ecmfiles.class.php', + DOL_DOCUMENT_ROOT . '/core/class/ecmfiles.class.php', + dirname(__FILE__) . '/../../../../core/class/ecmfiles.class.php' + ); + + $ecmfiles_path = null; + foreach ($ecmfiles_paths as $path) { + if (file_exists($path)) { + $ecmfiles_path = $path; + break; + } } - } - - if ($ecmfiles_path && file_exists($ecmfiles_path)) { + + if ($ecmfiles_path && file_exists($ecmfiles_path)) { try { + // Log the path being used for debugging + error_log("DeclarationTVA: Using ECM files path: " . $ecmfiles_path); require_once $ecmfiles_path; $ecmfile = new EcmFiles($this->db);