From 4f3ad7fb8a75ecf284c9147979da77f4a5d9b1c4 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Mon, 6 Oct 2025 17:48:39 +0200 Subject: [PATCH] Fix PDF download URL by removing extra /documents path - Added str_replace to remove /documents/documents/ from path - Changes /documents/documents/declarationtva/ to /documents/declarationtva/ - Should now generate correct URLs that match actual file locations - File is at /var/lib/dolibarr/documents/documents/declarationtva/ - URL should be /dolibarr/documents/declarationtva/ --- declarationtvaindex.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/declarationtvaindex.php b/declarationtvaindex.php index 41e8064..088a0a9 100644 --- a/declarationtvaindex.php +++ b/declarationtvaindex.php @@ -155,6 +155,8 @@ 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); $download_url = DOL_URL_ROOT . $relative_path; print ''; print ' PDF';