Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reset occ command #2831

Merged
merged 1 commit into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/Db/StepMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,22 @@ public function deleteAll($documentId): void {
$qb = $this->db->getQueryBuilder();
$qb->delete($this->getTableName())
->where($qb->expr()->eq('document_id', $qb->createNamedParameter($documentId)))
->execute();
->executeStatement();
}

public function deleteBeforeVersion($documentId, $version): void {
$qb = $this->db->getQueryBuilder();
$qb->delete($this->getTableName())
->where($qb->expr()->eq('document_id', $qb->createNamedParameter($documentId)))
->andWhere($qb->expr()->lte('version', $qb->createNamedParameter($version)))
->execute();
->executeStatement();
}

public function deleteAfterVersion($documentId, $version): int {
$qb = $this->db->getQueryBuilder();
$result = $qb->delete($this->getTableName())
return $qb->delete($this->getTableName())
->where($qb->expr()->eq('document_id', $qb->createNamedParameter($documentId)))
->andWhere($qb->expr()->gt('version', $qb->createNamedParameter($version)))
->execute();
return $result->rowCount();
->executeStatement();
}
}
2 changes: 1 addition & 1 deletion lib/Service/DocumentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public function autosave($file, $documentId, $version, $autoaveDocument, $force
* @param bool $force
* @throws DocumentHasUnsavedChangesException
*/
public function resetDocument($documentId, $force = false): void {
public function resetDocument(int $documentId, $force = false): void {
try {
$this->unlock($documentId);

Expand Down