From 1b5284a8b78b20b76c6ae6728c2ec9eb7ddd18bf Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 21 Aug 2026 11:39:33 -0400 Subject: [PATCH] Enhance Radar sync feedback: implement fallback for sync messages using query strings and update view logic to ensure consistent display of sync results. Improve styling for better visibility in the UI. --- v4_ci4/app/Controllers/Radar.php | 12 +++++++++++- v4_ci4/app/Views/radar/index.php | 6 +++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/v4_ci4/app/Controllers/Radar.php b/v4_ci4/app/Controllers/Radar.php index 6b5a1927..81c1b525 100644 --- a/v4_ci4/app/Controllers/Radar.php +++ b/v4_ci4/app/Controllers/Radar.php @@ -18,6 +18,12 @@ class Radar extends BaseController $ready = $model->tablesExist(); $cfg = config(RadarConfig::class); + // Flash session souvent perdu sous /v4/ — fallback query string. + $syncMsg = session()->getFlashdata('radar_sync_msg'); + if ($syncMsg === null || $syncMsg === '') { + $syncMsg = $this->request->getGet('sync_msg'); + } + return view('radar/index', [ 'ready' => $ready, 'exceptions' => $ready ? $model->listExceptions() : [], @@ -25,6 +31,7 @@ class Radar extends BaseController 'feedUrl' => site_url('v4/radar/feed'), 'syncUrl' => site_url('v4/radar/sync'), 'allowlist' => $cfg->mailboxAllowlist, + 'syncMsg' => is_string($syncMsg) ? $syncMsg : null, ]); } @@ -74,6 +81,9 @@ class Radar extends BaseController } } - return redirect()->to(site_url('v4/radar'))->with('radar_sync_msg', $msg); + // Message aussi en query : visible même si la flash session CI4 ne tient pas. + $q = rawurlencode(mb_substr($msg, 0, 800)); + + return redirect()->to(site_url('v4/radar') . '?sync_msg=' . $q)->with('radar_sync_msg', $msg); } } diff --git a/v4_ci4/app/Views/radar/index.php b/v4_ci4/app/Views/radar/index.php index 52fe5d08..f3d98494 100644 --- a/v4_ci4/app/Views/radar/index.php +++ b/v4_ci4/app/Views/radar/index.php @@ -12,7 +12,7 @@ $threads = $threads ?? []; $feedUrl = $feedUrl ?? site_url('v4/radar/feed'); $syncUrl = $syncUrl ?? site_url('v4/radar/sync'); $allowlist = $allowlist ?? []; -$syncMsg = session()->getFlashdata('radar_sync_msg'); +$syncMsg = $syncMsg ?? session()->getFlashdata('radar_sync_msg'); $statusLabel = static function (string $status): string { return match ($status) { @@ -64,8 +64,8 @@ $statusClass = static function (string $status): string { -
- Résultat sync : +
+ Résultat sync :