From a16b02293a97bfa6d90221432a05a00479e4ec92 Mon Sep 17 00:00:00 2001 From: Pablo Zmdl Date: Fri, 23 Jan 2026 17:10:21 +0100 Subject: [PATCH] Turn install_latest_major property into a string so we can save a version string or number I chose a string instead of an integer so we have more freedom what to actually save (maybe we want to include minor version digits at one point). Signed-off-by: Pablo Zmdl --- php/src/Controller/DockerController.php | 8 +++++++- php/src/Data/ConfigurationManager.php | 7 ++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/php/src/Controller/DockerController.php b/php/src/Controller/DockerController.php index 7078b71f..47c6c259 100644 --- a/php/src/Controller/DockerController.php +++ b/php/src/Controller/DockerController.php @@ -177,8 +177,14 @@ readonly class DockerController { $port = 443; } + if (isset($request->getParsedBody()['install_latest_major'])) { + $install_latest_major = '32'; + } else { + $install_latest_major = ''; + } + $this->configurationManager->startTransaction(); - $this->configurationManager->install_latest_major = isset($request->getParsedBody()['install_latest_major']); + $this->configurationManager->install_latest_major = $install_latest_major; // set AIO_URL $this->configurationManager->AIO_URL = $host . ':' . (string)$port . $path; // set wasStartButtonClicked diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index b7916b16..7ca0f8bc 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -68,8 +68,9 @@ class ConfigurationManager set { $this->set('wasStartButtonClicked', $value); } } - public bool $install_latest_major { - get => $this->get('install_latest_major', false); + public string $install_latest_major { + // Type-cast because old configs could have integers for this key. + get => (string) $this->get('install_latest_major', ''); set { $this->set('install_latest_major', $value); } } @@ -1080,7 +1081,7 @@ class ConfigurationManager 'NEXTCLOUD_STARTUP_APPS' => $this->GetNextcloudStartupApps(), 'NEXTCLOUD_ADDITIONAL_APKS' => $this->GetNextcloudAdditionalApks(), 'NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS' => $this->GetNextcloudAdditionalPhpExtensions(), - 'INSTALL_LATEST_MAJOR' => $this->install_latest_major ? 'yes' : '', + 'INSTALL_LATEST_MAJOR' => $this->install_latest_major, 'REMOVE_DISABLED_APPS' => $this->shouldDisabledAppsGetRemoved() ? 'yes' : '', // Allow to get local ip-address of database container which allows to talk to it even in host mode (the container that requires this needs to be started first then) 'AIO_DATABASE_HOST' => gethostbyname('nextcloud-aio-database'),