mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #31491 from nextcloud/fix/user_ldap-fix-duplicated-empty-uuid-migration
Fix duplicated UUID detection when there are empty uuids
This commit is contained in:
commit
53e30c40bc
4 changed files with 7 additions and 7 deletions
|
|
@ -438,14 +438,14 @@ abstract class AbstractMapping {
|
|||
$picker = $this->dbc->getQueryBuilder();
|
||||
$picker->select('owncloud_name')
|
||||
->from($this->getTableName());
|
||||
$cursor = $picker->execute();
|
||||
$cursor = $picker->executeQuery();
|
||||
$result = true;
|
||||
while ($id = $cursor->fetchOne()) {
|
||||
while (($id = $cursor->fetchOne()) !== false) {
|
||||
$preCallback($id);
|
||||
if ($isUnmapped = $this->unmap($id)) {
|
||||
$postCallback($id);
|
||||
}
|
||||
$result &= $isUnmapped;
|
||||
$result = $result && $isUnmapped;
|
||||
}
|
||||
$cursor->closeCursor();
|
||||
return $result;
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ class Version1130Date20211102154716 extends SimpleMigrationStep {
|
|||
|
||||
$result = $select->executeQuery();
|
||||
$idList = [];
|
||||
while ($id = $result->fetchOne()) {
|
||||
while (($id = $result->fetchOne()) !== false) {
|
||||
$idList[] = $id;
|
||||
}
|
||||
$result->closeCursor();
|
||||
|
|
@ -278,7 +278,7 @@ class Version1130Date20211102154716 extends SimpleMigrationStep {
|
|||
->having($select->expr()->gt($select->func()->count('owncloud_name'), $select->createNamedParameter(1)));
|
||||
|
||||
$result = $select->executeQuery();
|
||||
while ($uuid = $result->fetchOne()) {
|
||||
while (($uuid = $result->fetchOne()) !== false) {
|
||||
yield $uuid;
|
||||
}
|
||||
$result->closeCursor();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue