From 93505b2cdd62fe60a09ea35164014a914627394e Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 13 Nov 2023 13:11:26 +0100 Subject: [PATCH] fix(workflowengine): use andWhere() not second where() - an unconditional where() condition is added right before - fixes also wrongly named methods in the Exception message Signed-off-by: Arthur Schiwon --- apps/workflowengine/lib/Manager.php | 2 +- lib/private/DB/QueryBuilder/QueryBuilder.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php index 28bc4417bb9..d8be5e4f8df 100644 --- a/apps/workflowengine/lib/Manager.php +++ b/apps/workflowengine/lib/Manager.php @@ -333,7 +333,7 @@ class Manager implements IManager { ->where($qb->expr()->eq('s.type', $qb->createParameter('scope'))); if ($scopeContext->getScope() !== IManager::SCOPE_ADMIN) { - $qb->where($qb->expr()->eq('s.value', $qb->createParameter('scopeId'))); + $qb->andWhere($qb->expr()->eq('s.value', $qb->createParameter('scopeId'))); } $qb->setParameters(['scope' => $scopeContext->getScope(), 'scopeId' => $scopeContext->getScopeId()]); diff --git a/lib/private/DB/QueryBuilder/QueryBuilder.php b/lib/private/DB/QueryBuilder/QueryBuilder.php index 30dc02b0c16..c2818911ccf 100644 --- a/lib/private/DB/QueryBuilder/QueryBuilder.php +++ b/lib/private/DB/QueryBuilder/QueryBuilder.php @@ -866,7 +866,7 @@ class QueryBuilder implements IQueryBuilder { public function where(...$predicates) { if ($this->getQueryPart('where') !== null && $this->systemConfig->getValue('debug', false)) { // Only logging a warning, not throwing for now. - $e = new QueryException('Using where() on non-empty WHERE part, please verify it is intentional to not call whereAnd() or whereOr() instead. Otherwise consider creating a new query builder object or call resetQueryPart(\'where\') first.'); + $e = new QueryException('Using where() on non-empty WHERE part, please verify it is intentional to not call andWhere() or orWhere() instead. Otherwise consider creating a new query builder object or call resetQueryPart(\'where\') first.'); $this->logger->warning($e->getMessage(), ['exception' => $e]); } -- 2.39.5