Skip to content

Commit 0b5c372

Browse files
authored
Merge pull request #36081 from nextcloud/stable25-fix/fix-theming-repair-step
[stable25] Fix theming migration repair step by passing correct type for argument
2 parents c50b379 + e127a92 commit 0b5c372

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

apps/theming/lib/Jobs/MigrateBackgroundImages.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ public function __construct(
6969
}
7070

7171
protected function run($argument): void {
72-
if (!isset($argument['stage'])) {
73-
// not executed in 25.0.0?!
74-
$argument['stage'] = self::STAGE_PREPARE;
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)