mirror of
https://github.com/nextcloud/server.git
synced 2026-03-26 20:33:55 -04:00
Merge pull request #30001 from nextcloud/fix/subscription-id-int
Cast orphan subscription id to int
This commit is contained in:
commit
3a1ef2b012
1 changed files with 5 additions and 4 deletions
|
|
@ -41,7 +41,8 @@ class RemoveDeletedUsersCalendarSubscriptions implements IRepairStep {
|
|||
/** @var int */
|
||||
private $progress = 0;
|
||||
|
||||
private $orphanSubscriptions = [];
|
||||
/** @var int[] */
|
||||
private $orphanSubscriptionIds = [];
|
||||
|
||||
private const SUBSCRIPTIONS_CHUNK_SIZE = 1000;
|
||||
|
||||
|
|
@ -74,7 +75,7 @@ class RemoveDeletedUsersCalendarSubscriptions implements IRepairStep {
|
|||
$output->finishProgress();
|
||||
$this->deleteOrphanSubscriptions();
|
||||
|
||||
$output->info(sprintf('%d calendar subscriptions without an user have been cleaned up', count($this->orphanSubscriptions)));
|
||||
$output->info(sprintf('%d calendar subscriptions without an user have been cleaned up', count($this->orphanSubscriptionIds)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -112,7 +113,7 @@ class RemoveDeletedUsersCalendarSubscriptions implements IRepairStep {
|
|||
while ($row = $result->fetch()) {
|
||||
$username = $this->getPrincipal($row['principaluri']);
|
||||
if (!$this->userManager->userExists($username)) {
|
||||
$this->orphanSubscriptions[] = $row['id'];
|
||||
$this->orphanSubscriptionIds[] = (int) $row['id'];
|
||||
}
|
||||
}
|
||||
$result->closeCursor();
|
||||
|
|
@ -122,7 +123,7 @@ class RemoveDeletedUsersCalendarSubscriptions implements IRepairStep {
|
|||
* @throws Exception
|
||||
*/
|
||||
private function deleteOrphanSubscriptions(): void {
|
||||
foreach ($this->orphanSubscriptions as $orphanSubscriptionID) {
|
||||
foreach ($this->orphanSubscriptionIds as $orphanSubscriptionID) {
|
||||
$this->deleteOrphanSubscription($orphanSubscriptionID);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue