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
This commit is contained in:
Adam Daley authored and GitHub committed 2026-01-17 00:45:05 +00:00
1 parent 85d0e1ad84
commit 388826d4bd
1 file changed
+5 -5
+5 -5
View File
@@ -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();