From 519f5e3be24f7aa47a9f0911dcaf6a2e4e3fa9df Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Mon, 6 Oct 2025 17:50:20 +0200 Subject: [PATCH] Revert PDF URL path fix - keep original /documents/documents/ structure - Removed the str_replace that was removing /documents/documents/ - The file is actually saved with /documents/documents/ in the path - URL should match the actual file location - Should generate URLs like /dolibarr/documents/documents/declarationtva/ --- declarationtvaindex.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/declarationtvaindex.php b/declarationtvaindex.php index 088a0a9..cfb6ca4 100644 --- a/declarationtvaindex.php +++ b/declarationtvaindex.php @@ -155,8 +155,7 @@ if (empty($declarations)) { if ($pdf_path) { // Create a download link $relative_path = str_replace(DOL_DATA_ROOT, '', $pdf_path); - // Remove the extra /documents from the path - $relative_path = str_replace('/documents/documents/', '/documents/', $relative_path); + // The file is saved with /documents/documents/ so we need to keep that in the URL $download_url = DOL_URL_ROOT . $relative_path; print ''; print ' PDF';