fix: clean attachment sharing records after permanent deleted
Signed-off-by: Luka Trovic <luka@nextcloud.com>
This commit is contained in:
committed by
backportbot[bot]
parent
bac68412c5
commit
607c89739e
@@ -1045,4 +1045,21 @@ class DeckShareProvider implements \OCP\Share\IShareProvider {
|
||||
}
|
||||
$cursor->closeCursor();
|
||||
}
|
||||
|
||||
public function getOrphanedAttachmentShares(): array {
|
||||
$allCardIds = $this->cardMapper->getAllCardIds();
|
||||
$qb = $this->dbConnection->getQueryBuilder();
|
||||
$qb->select('*')
|
||||
->from('share', 's')
|
||||
->where($qb->expr()->eq('s.share_type', $qb->createNamedParameter(IShare::TYPE_DECK)))
|
||||
->andWhere($qb->expr()->notIn('s.share_with', $qb->createNamedParameter($allCardIds, IQueryBuilder::PARAM_STR_ARRAY)));
|
||||
|
||||
$cursor = $qb->execute();
|
||||
$shares = [];
|
||||
while ($data = $cursor->fetch()) {
|
||||
$shares[] = $this->createShareObject($data);
|
||||
}
|
||||
|
||||
return $shares;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user