From 7c67d273aae0f79a0483e6a8382725a140881a6e Mon Sep 17 00:00:00 2001 From: fs Date: Tue, 21 Apr 2026 22:31:42 +0200 Subject: [PATCH] fix(audit): reach system-audit export via target path, not route path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The export dropdown built URLs via lurl('admin/system-audit/export') which hit a framework quirk: MintyPHP Router::applyRoutes() compares the full request URI (including ?query) against registered source paths. When a browser fetched /de/admin/system-audit/export?format=csv the rewrite to audit/system-audit/export silently missed, the router fell back to file-based resolution, found no such file under admin/, and redirected back to the list page — the user saw the grid "reload" and nothing downloaded. Only audit is affected because it is the only module where the route path (admin/…) differs from the page target path (audit/…); helpdesk and admin/users route paths equal their targets so file-based routing catches the export URL even when applyRoutes misses. Fix: use lurl('audit/system-audit/export') in the page config — the target path — which resolves directly via file-based routing regardless of query string. This matches the convention the same JS already uses for `dataUrl: 'audit/system-audit/data'`. Short inline comment records why. Co-Authored-By: Claude Opus 4.7 (1M context) --- modules/audit/pages/audit/system-audit/index(default).phtml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/audit/pages/audit/system-audit/index(default).phtml b/modules/audit/pages/audit/system-audit/index(default).phtml index 1d7d4b2..f25ba73 100644 --- a/modules/audit/pages/audit/system-audit/index(default).phtml +++ b/modules/audit/pages/audit/system-audit/index(default).phtml @@ -46,7 +46,11 @@ $pageConfig = [ 'filterSchema' => $clientFilterSchema, 'filterChipMeta' => $filterChipMeta, 'gridLang' => $gridLang, - 'exportUrl' => lurl('admin/system-audit/export'), + // Uses the page target path, not the registered route path: the Router's + // applyRoutes() rewrite does not strip query strings before matching, so + // "admin/system-audit/export?format=csv" would miss the rewrite and 404. + // Matches the convention already used for `dataUrl: 'audit/system-audit/data'`. + 'exportUrl' => lurl('audit/system-audit/export'), 'labels' => [ 'created' => t('Created'), 'status' => t('Status'),