From e445be12028c0d33c0a7f0ed8693e3a67c0f999c Mon Sep 17 00:00:00 2001 From: provokateurin Date: Wed, 2 Oct 2024 11:55:27 +0200 Subject: [PATCH 1/6] fix(QueryBuilder): Account for aliases in output columns Signed-off-by: provokateurin --- lib/private/DB/QueryBuilder/QueryBuilder.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index b42b380e3d0fa..56c860bc42c13 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -582,6 +582,9 @@ private function addOutputColumns(array $columns): void { if (is_array($column)) { $this->addOutputColumns($column); } elseif (is_string($column) && !str_contains($column, '*')) { + if (str_contains(strtolower($column), ' as ')) { + [, $column] = preg_split('/ as /i', $column); + } if (str_contains($column, '.')) { [, $column] = explode('.', $column); } @@ -591,14 +594,7 @@ private function addOutputColumns(array $columns): void { } public function getOutputColumns(): array { - return array_unique(array_map(function (string $column) { - if (str_contains($column, '.')) { - [, $column] = explode('.', $column); - return $column; - } else { - return $column; - } - }, $this->selectedColumns)); + return array_unique($this->selectedColumns); } /** From 96f77d7b99d231d2ec16ee618ec9a2e6b5aa8500 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 2 Oct 2024 23:27:44 +0200 Subject: [PATCH 2/6] fix(filesexternal): Remove unneeded 3rdparty library use Signed-off-by: Joas Schilling --- apps/files_external/lib/Command/Applicable.php | 8 ++++---- apps/files_external/lib/Command/Config.php | 4 ++-- apps/files_external/lib/Command/Create.php | 6 +++--- apps/files_external/lib/Command/Delete.php | 4 ++-- apps/files_external/lib/Command/Verify.php | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/files_external/lib/Command/Applicable.php b/apps/files_external/lib/Command/Applicable.php index e7305f5867181..ecb635c052a47 100644 --- a/apps/files_external/lib/Command/Applicable.php +++ b/apps/files_external/lib/Command/Applicable.php @@ -10,13 +10,13 @@ use OCA\Files_External\Lib\StorageConfig; use OCA\Files_External\NotFoundException; use OCA\Files_External\Service\GlobalStoragesService; +use OCP\AppFramework\Http; use OCP\IGroupManager; use OCP\IUserManager; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\HttpFoundation\Response; class Applicable extends Base { public function __construct( @@ -70,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $mount = $this->globalService->getStorage($mountId); } catch (NotFoundException $e) { $output->writeln('Mount with id "' . $mountId . ' not found, check "occ files_external:list" to get available mounts'); - return Response::HTTP_NOT_FOUND; + return Http::STATUS_NOT_FOUND; } if ($mount->getType() === StorageConfig::MOUNT_TYPE_PERSONAL) { @@ -90,13 +90,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int foreach ($addUsers as $addUser) { if (!$this->userManager->userExists($addUser)) { $output->writeln('User "' . $addUser . '" not found'); - return Response::HTTP_NOT_FOUND; + return Http::STATUS_NOT_FOUND; } } foreach ($addGroups as $addGroup) { if (!$this->groupManager->groupExists($addGroup)) { $output->writeln('Group "' . $addGroup . '" not found'); - return Response::HTTP_NOT_FOUND; + return Http::STATUS_NOT_FOUND; } } diff --git a/apps/files_external/lib/Command/Config.php b/apps/files_external/lib/Command/Config.php index fa44a71785988..f677e51d60435 100644 --- a/apps/files_external/lib/Command/Config.php +++ b/apps/files_external/lib/Command/Config.php @@ -10,10 +10,10 @@ use OCA\Files_External\Lib\StorageConfig; use OCA\Files_External\NotFoundException; use OCA\Files_External\Service\GlobalStoragesService; +use OCP\AppFramework\Http; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\HttpFoundation\Response; class Config extends Base { public function __construct( @@ -49,7 +49,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $mount = $this->globalService->getStorage($mountId); } catch (NotFoundException $e) { $output->writeln('Mount with id "' . $mountId . ' not found, check "occ files_external:list" to get available mounts"'); - return Response::HTTP_NOT_FOUND; + return Http::STATUS_NOT_FOUND; } $value = $input->getArgument('value'); diff --git a/apps/files_external/lib/Command/Create.php b/apps/files_external/lib/Command/Create.php index 0183b3014c8d1..4396d2e2b13df 100644 --- a/apps/files_external/lib/Command/Create.php +++ b/apps/files_external/lib/Command/Create.php @@ -17,6 +17,7 @@ use OCA\Files_External\Service\GlobalStoragesService; use OCA\Files_External\Service\StoragesService; use OCA\Files_External\Service\UserStoragesService; +use OCP\AppFramework\Http; use OCP\IUserManager; use OCP\IUserSession; use Symfony\Component\Console\Input\ArrayInput; @@ -24,7 +25,6 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\HttpFoundation\Response; class Create extends Base { public function __construct( @@ -93,11 +93,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int } if (is_null($storageBackend)) { $output->writeln('Storage backend with identifier "' . $storageIdentifier . '" not found (see `occ files_external:backends` for possible values)'); - return Response::HTTP_NOT_FOUND; + return Http::STATUS_NOT_FOUND; } if (is_null($authBackend)) { $output->writeln('Authentication backend with identifier "' . $authIdentifier . '" not found (see `occ files_external:backends` for possible values)'); - return Response::HTTP_NOT_FOUND; + return Http::STATUS_NOT_FOUND; } $supportedSchemes = array_keys($storageBackend->getAuthSchemes()); if (!in_array($authBackend->getScheme(), $supportedSchemes)) { diff --git a/apps/files_external/lib/Command/Delete.php b/apps/files_external/lib/Command/Delete.php index 077b969d7b269..61e974ff58957 100644 --- a/apps/files_external/lib/Command/Delete.php +++ b/apps/files_external/lib/Command/Delete.php @@ -10,6 +10,7 @@ use OCA\Files_External\NotFoundException; use OCA\Files_External\Service\GlobalStoragesService; use OCA\Files_External\Service\UserStoragesService; +use OCP\AppFramework\Http; use OCP\IUserManager; use OCP\IUserSession; use Symfony\Component\Console\Input\ArrayInput; @@ -18,7 +19,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ConfirmationQuestion; -use Symfony\Component\HttpFoundation\Response; class Delete extends Base { public function __construct( @@ -53,7 +53,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $mount = $this->globalService->getStorage($mountId); } catch (NotFoundException $e) { $output->writeln('Mount with id "' . $mountId . ' not found, check "occ files_external:list" to get available mounts"'); - return Response::HTTP_NOT_FOUND; + return Http::STATUS_NOT_FOUND; } $noConfirm = $input->getOption('yes'); diff --git a/apps/files_external/lib/Command/Verify.php b/apps/files_external/lib/Command/Verify.php index 25b09fa111602..1455e427b77e3 100644 --- a/apps/files_external/lib/Command/Verify.php +++ b/apps/files_external/lib/Command/Verify.php @@ -11,12 +11,12 @@ use OCA\Files_External\Lib\StorageConfig; use OCA\Files_External\NotFoundException; use OCA\Files_External\Service\GlobalStoragesService; +use OCP\AppFramework\Http; use OCP\Files\StorageNotAvailableException; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\HttpFoundation\Response; class Verify extends Base { public function __construct( @@ -50,7 +50,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $mount = $this->globalService->getStorage($mountId); } catch (NotFoundException $e) { $output->writeln('Mount with id "' . $mountId . ' not found, check "occ files_external:list" to get available mounts"'); - return Response::HTTP_NOT_FOUND; + return Http::STATUS_NOT_FOUND; } $this->updateStorageStatus($mount, $configInput, $output); From 8e0c2726f801c83cc2a64346706e88bda6999e98 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Wed, 2 Oct 2024 16:13:43 -0700 Subject: [PATCH 3/6] fix(theming): Fix layout of themes Signed-off-by: Christopher Ng --- apps/theming/src/UserTheming.vue | 2 -- apps/theming/src/components/ItemPreview.vue | 5 ----- 2 files changed, 7 deletions(-) diff --git a/apps/theming/src/UserTheming.vue b/apps/theming/src/UserTheming.vue index a5c3d029158b3..4766886be903d 100644 --- a/apps/theming/src/UserTheming.vue +++ b/apps/theming/src/UserTheming.vue @@ -6,7 +6,6 @@