From 37a5a266df225d15849e4dbeaf36e67658d63248 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Thu, 10 Feb 2022 23:13:06 +0100 Subject: [PATCH] fix use of executeQuery and -Statement Signed-off-by: Arthur Schiwon --- apps/user_ldap/lib/Mapping/AbstractMapping.php | 2 +- .../lib/Migration/Version1130Date20211102154716.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php index 0a1f18b2fee..057c4de3d73 100644 --- a/apps/user_ldap/lib/Mapping/AbstractMapping.php +++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php @@ -343,7 +343,7 @@ abstract class AbstractMapping { $select->where($select->expr()->like('directory_uuid', $select->createNamedParameter('invalidated_%'))); } - $result = $select->executeQuery(); + $result = $select->execute(); $entries = $result->fetchAll(); $result->closeCursor(); diff --git a/apps/user_ldap/lib/Migration/Version1130Date20211102154716.php b/apps/user_ldap/lib/Migration/Version1130Date20211102154716.php index 52eca30625c..5956acf9ae1 100644 --- a/apps/user_ldap/lib/Migration/Version1130Date20211102154716.php +++ b/apps/user_ldap/lib/Migration/Version1130Date20211102154716.php @@ -216,7 +216,7 @@ class Version1130Date20211102154716 extends SimpleMigrationStep { $update->setParameter('nextcloudId', $nextcloudId); $update->setParameter('invalidatedUuid', 'invalidated_' . \bin2hex(\random_bytes(6))); try { - $update->executeStatement(); + $update->execute(); $this->logger->warning( 'LDAP user or group with ID {nid} has a duplicated UUID value which therefore was invalidated. You may double-check your LDAP configuration and trigger an update of the UUID.', [ @@ -247,7 +247,7 @@ class Version1130Date20211102154716 extends SimpleMigrationStep { ->from($table) ->where($select->expr()->eq('directory_uuid', $select->createNamedParameter($uuid))); - $result = $select->executeQuery(); + $result = $select->execute(); $idList = []; while ($id = $result->fetchOne()) { $idList[] = $id; @@ -267,7 +267,7 @@ class Version1130Date20211102154716 extends SimpleMigrationStep { ->groupBy('directory_uuid') ->having($select->expr()->gt($select->func()->count('owncloud_name'), $select->createNamedParameter(1))); - $result = $select->executeQuery(); + $result = $select->execute(); while ($uuid = $result->fetchOne()) { yield $uuid; }