]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix theming migration repair step by passing correct type for argument 36069/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 10 Jan 2023 13:59:43 +0000 (14:59 +0100)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 10 Jan 2023 13:59:43 +0000 (14:59 +0100)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
apps/theming/lib/Jobs/MigrateBackgroundImages.php

index 54c0d591e4049c55da6717d7579201ea59ee6fa8..97665d1179fde595fb99af7a97d7f759dbba750e 100644 (file)
@@ -68,10 +68,9 @@ class MigrateBackgroundImages extends QueuedJob {
                $this->logger = $logger;
        }
 
-       protected function run($argument): void {
-               if (!isset($argument['stage'])) {
-                       // not executed in 25.0.0?!
-                       $argument['stage'] = self::STAGE_PREPARE;
+       protected function run(mixed $argument): void {
+               if (!is_array($argument) || !isset($argument['stage'])) {
+                       throw new \Exception('Job '.self::class.' called with wrong argument');
                }
 
                switch ($argument['stage']) {
@@ -99,10 +98,10 @@ class MigrateBackgroundImages extends QueuedJob {
                        $userIds = $result->fetchAll(\PDO::FETCH_COLUMN);
                        $this->storeUserIdsToProcess($userIds);
                } catch (\Throwable $t) {
-                       $this->jobList->add(self::class, self::STAGE_PREPARE);
+                       $this->jobList->add(self::class, ['stage' => self::STAGE_PREPARE]);
                        throw $t;
                }
-               $this->jobList->add(self::class, self::STAGE_EXECUTE);
+               $this->jobList->add(self::class, ['stage' => self::STAGE_EXECUTE]);
        }
 
        /**