From abd4156a88886bfe7844093840719d1e28947e32 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Tue, 7 Oct 2025 20:23:52 +0200 Subject: [PATCH] Improve template management with better fallback messaging - Add informative messages when using local files due to Gitea inaccessibility - Provide clear feedback about fallback behavior - Maintain functionality even when Gitea server is not accessible - Support both online and offline template management scenarios --- core/class/declarationtva_pdf.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/class/declarationtva_pdf.class.php b/core/class/declarationtva_pdf.class.php index 521cea9..102e233 100644 --- a/core/class/declarationtva_pdf.class.php +++ b/core/class/declarationtva_pdf.class.php @@ -1542,6 +1542,8 @@ class DeclarationTVA_PDF $local_manifest = DOL_DOCUMENT_ROOT.'/custom/declarationtva/templates/manifest.json'; if (file_exists($local_manifest)) { $manifest_content = file_get_contents($local_manifest); + // Set a note that we're using local manifest + $update_info['error'] = 'Using local manifest (Gitea server not accessible)'; } if ($manifest_content === false) { $update_info['error'] = 'Failed to fetch manifest from Gitea and local file not found'; @@ -1600,6 +1602,8 @@ class DeclarationTVA_PDF $local_template = DOL_DOCUMENT_ROOT.'/custom/declarationtva/templates/declarationtva/ca3_official_template.pdf'; if (file_exists($local_template)) { $template_content = file_get_contents($local_template); + // Note that we're using local template + $this->error = 'Using local template (Gitea server not accessible)'; } if ($template_content === false) { $this->error = 'Failed to download template from Gitea and local file not found';