From 388826d4bdcf00a7279e04108b4e6496fdc200c7 Mon Sep 17 00:00:00 2001 From: Adam Daley Date: Sat, 17 Jan 2026 00:45:05 +0000 Subject: [PATCH] Persist currency selection on installation validation failure (#3167) Fix: Persist currency selection on installation validation failure (#2746) - Move currency session storage before validation steps - Prevents currency from resetting to USD when database connection or admin validation fails - Ensures consistent behavior with other form fields --- src/install/install.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/install/install.php b/src/install/install.php index 64a3b5a58..602497d6b 100644 --- a/src/install/install.php +++ b/src/install/install.php @@ -152,6 +152,11 @@ final class FOSSBilling_Installer // Set if they've opted into error reporting $this->session->set('error_reporting', $_POST['error_reporting']); + // Set up default currency before validation to preserve user selection if validation fails + $this->session->set('currency_code', $_POST['currency_code']); + $this->session->set('currency_title', $_POST['currency_title']); + $this->session->set('currency_format', $_POST['currency_format'] ?? '${{price}}'); + // Handle database information $this->session->set('database_hostname', $_POST['database_hostname']); $this->session->set('database_port', $_POST['database_port']); @@ -173,11 +178,6 @@ final class FOSSBilling_Installer $this->validateAdmin(); - // Set up default currency - $this->session->set('currency_code', $_POST['currency_code']); - $this->session->set('currency_title', $_POST['currency_title']); - $this->session->set('currency_format', $_POST['currency_format'] ?? '${{price}}'); - // Attempt installation $this->install(); $this->generateEmailTemplates();