aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/lib
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-03-08 12:10:52 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-03-08 12:10:52 +0100
commitccab35f23f3b102b11f93e1d5e7e2f4fadadb56f (patch)
treee38f983fa2e61d5a798398d91876de968db23da7 /apps/workflowengine/lib
parent65a866556bf871f98ab6486dd104e758c06f039b (diff)
downloadnextcloud-server-ccab35f23f3b102b11f93e1d5e7e2f4fadadb56f.tar.gz
nextcloud-server-ccab35f23f3b102b11f93e1d5e7e2f4fadadb56f.zip
Fix similar potential problems with fetchOne loops
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/workflowengine/lib')
-rw-r--r--apps/workflowengine/lib/Manager.php2
-rw-r--r--apps/workflowengine/lib/Migration/PopulateNewlyIntroducedDatabaseFields.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php
index 178bc87365b..34dbf507b91 100644
--- a/apps/workflowengine/lib/Manager.php
+++ b/apps/workflowengine/lib/Manager.php
@@ -351,7 +351,7 @@ class Manager implements IManager {
$result = $qb->execute();
$this->operationsByScope[$scopeContext->getHash()] = [];
- while ($opId = $result->fetchOne()) {
+ while (($opId = $result->fetchOne()) !== false) {
$this->operationsByScope[$scopeContext->getHash()][] = (int)$opId;
}
$result->closeCursor();
diff --git a/apps/workflowengine/lib/Migration/PopulateNewlyIntroducedDatabaseFields.php b/apps/workflowengine/lib/Migration/PopulateNewlyIntroducedDatabaseFields.php
index 019d3ae6bcc..974793e99b2 100644
--- a/apps/workflowengine/lib/Migration/PopulateNewlyIntroducedDatabaseFields.php
+++ b/apps/workflowengine/lib/Migration/PopulateNewlyIntroducedDatabaseFields.php
@@ -57,7 +57,7 @@ class PopulateNewlyIntroducedDatabaseFields implements IRepairStep {
$qb = $this->dbc->getQueryBuilder();
$insertQuery = $qb->insert('flow_operations_scope');
- while ($id = $ids->fetchOne()) {
+ while (($id = $ids->fetchOne()) !== false) {
$insertQuery->values(['operation_id' => $qb->createNamedParameter($id), 'type' => IManager::SCOPE_ADMIN]);
$insertQuery->execute();
}