Skip to content

Commit

Permalink
Merge pull request #41429 from nextcloud/backport/41417/stable27
Browse files Browse the repository at this point in the history
[stable27] fix(workflowengine): use andWhere() not second where()
  • Loading branch information
blizzz authored Nov 13, 2023
2 parents 2bc499c + bf301df commit 712a4c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/workflowengine/lib/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ protected function canModify(int $id, ScopeContext $scopeContext):bool {
->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()]);
Expand Down
2 changes: 1 addition & 1 deletion lib/private/DB/QueryBuilder/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ public function set($key, $value) {
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]);
}

Expand Down

0 comments on commit 712a4c8

Please sign in to comment.