Skip to content

Commit a9f92b6

Browse files
authored
Merge pull request #36069 from nextcloud/fix/fix-theming-repair-step
Fix theming migration repair step by passing correct type for argument
2 parents 06b1adf + 09099cf commit a9f92b6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

apps/theming/lib/Jobs/MigrateBackgroundImages.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@ public function __construct(
6868
$this->logger = $logger;
6969
}
7070

71-
protected function run($argument): void {
72-
if (!isset($argument['stage'])) {
73-
// not executed in 25.0.0?!
74-
$argument['stage'] = self::STAGE_PREPARE;
71+
protected function run(mixed $argument): void {
72+
if (!is_array($argument) || !isset($argument['stage'])) {
73+
throw new \Exception('Job '.self::class.' called with wrong argument');
7574
}
7675

7776
switch ($argument['stage']) {
@@ -99,10 +98,10 @@ protected function runPreparation(): void {
9998
$userIds = $result->fetchAll(\PDO::FETCH_COLUMN);
10099
$this->storeUserIdsToProcess($userIds);
101100
} catch (\Throwable $t) {
102-
$this->jobList->add(self::class, self::STAGE_PREPARE);
101+
$this->jobList->add(self::class, ['stage' => self::STAGE_PREPARE]);
103102
throw $t;
104103
}
105-
$this->jobList->add(self::class, self::STAGE_EXECUTE);
104+
$this->jobList->add(self::class, ['stage' => self::STAGE_EXECUTE]);
106105
}
107106

108107
/**

0 commit comments

Comments
 (0)