Skip to content

Commit

Permalink
Fix theming migration repair step by passing correct type for argument
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Jan 10, 2023
1 parent 4ecf4b4 commit 09099cf
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions apps/theming/lib/Jobs/MigrateBackgroundImages.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,9 @@ public function __construct(
$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']) {
Expand Down Expand Up @@ -99,10 +98,10 @@ protected function runPreparation(): void {
$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]);
}

/**
Expand Down

0 comments on commit 09099cf

Please sign in to comment.