From 546474346f86de80d70683552f54bc4d0b01de80 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Apr 2026 08:17:03 +0000 Subject: [PATCH] some general fixes to the code base - Fix return vs continue in CreateVolumes: using return caused all subsequent volumes to be skipped when nextcloud_aio_nextcloud_datadir or nextcloud_aio_backupdir appeared in the volume list - Fix GetLogs parsing loop: the while loop checked $line before reassigning it so the false sentinel from strtok was always processed, appending a spurious extra empty line to the output - Fix getRegisteredSecret unsafe array access: accessing $this->secrets[$secretId] without isset() can trigger an undefined array key warning; use isset() instead - Remove redundant startTransaction() call in setDomain(): the method called startTransaction() twice without an intervening commitTransaction(), making the second call a no-op that was misleading Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/19424687-dda1-4510-8f70-068c8d3efd41 Co-Authored-By: szaimen <42591237+szaimen@users.noreply.github.com> Signed-off-by: Simon L. --- php/src/Data/ConfigurationManager.php | 3 +-- php/src/Docker/DockerActionManager.php | 11 ++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index 029a377f..b226a139 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -363,7 +363,7 @@ class ConfigurationManager } public function getRegisteredSecret(string $secretId) : string { - if ($this->secrets[$secretId]) { + if (isset($this->secrets[$secretId])) { return $this->getAndGenerateSecret($secretId); } throw new \Exception("The secret " . $secretId . " was not registered. Please check if it is defined in secrets of containers.json."); @@ -563,7 +563,6 @@ class ConfigurationManager $this->set('domain', $domain); // Reset the borg restore password when setting the domain $this->borgRestorePassword = ''; - $this->startTransaction(); $this->commitTransaction(); } diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php index 2edad1ed..940814fe 100644 --- a/php/src/Docker/DockerActionManager.php +++ b/php/src/Docker/DockerActionManager.php @@ -157,11 +157,12 @@ readonly class DockerActionManager { $response = ""; $separator = "\r\n"; $line = strtok($responseBody, $separator); - $response = substr((string)$line, 8) . $separator; + if ($line !== false) { + $response = substr($line, 8) . $separator; + } - while ($line !== false) { - $line = strtok($separator); - $response .= substr((string)$line, 8) . $separator; + while (($line = strtok($separator)) !== false) { + $response .= substr($line, 8) . $separator; } return $response; @@ -187,7 +188,7 @@ readonly class DockerActionManager { ]; if ($volume->name === 'nextcloud_aio_nextcloud_datadir' || $volume->name === 'nextcloud_aio_backupdir') { - return; + continue; } $firstChar = substr($volume->name, 0, 1);