Commit c975426b authored by Benni Mack's avatar Benni Mack Committed by Oliver Bartsch
Browse files

[TASK] Doctrine DBAL: Use fetchAssociative() instead of fetch()

This change migrates $result->fetch() methods
to $result->fetchAssociative() and $result->closeCursor()
to $result->free() methods.

Since TYPO3 uses fetchMode "associative" by default when
setting up the connections, this change is another
step towards Doctrine DBAL 3.0 compatibility.

Resolves: #94659
Releases: master
Change-Id: Idce7c8466925a6e58059e7e16ebc3ffe35ca6fa6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70125

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent e5805210
......@@ -835,7 +835,7 @@ class DataHandlerHook
}
$statement = $queryBuilder->execute();
while ($record = $statement->fetch()) {
while ($record = $statement->fetchAssociative()) {
$updateFields = [];
$dataTypes = [\PDO::PARAM_INT];
if ((int)$record[$l10nParentFieldName] === $previouslyUsedVersionId) {
......@@ -1043,7 +1043,7 @@ class DataHandlerHook
}
$statement = $queryBuilder->execute();
while ($record = $statement->fetch()) {
while ($record = $statement->fetchAssociative()) {
$dataHandler->updateRefIndex($table, $record['uid']);
}
}
......@@ -1262,7 +1262,7 @@ class DataHandlerHook
)
->execute();
while ($row = $statement->fetch()) {
while ($row = $statement->fetchAssociative()) {
$elementData[$table][] = [$row['uid'], $row['offlineUid']];
}
}
......@@ -1318,7 +1318,7 @@ class DataHandlerHook
->groupBy('A.uid')
->execute();
while ($row = $statement->fetch()) {
while ($row = $statement->fetchAssociative()) {
$elementList[$table][] = $row['uid'];
}
if (is_array($elementList[$table])) {
......@@ -1373,7 +1373,7 @@ class DataHandlerHook
->groupBy('B.pid')
->execute();
while ($row = $statement->fetch()) {
while ($row = $statement->fetchAssociative()) {
$pageIdList[] = $row['pid'];
// Find ws version
// Note: cannot use BackendUtility::getRecordWSOL()
......
......@@ -294,7 +294,7 @@ class WorkspacePreview implements MiddlewareInterface
)
->setMaxResults(1)
->execute()
->fetch();
->fetchAssociative();
}
/**
......
......@@ -295,7 +295,7 @@ class PreviewUriBuilder
)
->execute();
while ($row = $result->fetch()) {
while ($row = $result->fetchAssociative()) {
$languageId = (int)$row['sys_language_uid'];
// Only add links to active languages the user has access to
if (isset($systemLanguages[$languageId]) && $this->getBackendUser()->checkLanguageAccess($languageId)) {
......
......@@ -71,7 +71,7 @@ class WorkspaceService implements SingletonInterface
->orderBy('title')
->execute();
while ($workspace = $result->fetch()) {
while ($workspace = $result->fetchAssociative()) {
if ($GLOBALS['BE_USER']->checkWorkspace($workspace)) {
$availableWorkspaces[$workspace['uid']] = $workspace['title'];
}
......@@ -692,7 +692,7 @@ class WorkspaceService implements SingletonInterface
->execute();
$movedAwayPages = [];
while ($row = $result->fetch()) {
while ($row = $result->fetchAssociative()) {
$movedAwayPages[$row['t3ver_oid']] = $row;
}
......@@ -728,7 +728,7 @@ class WorkspaceService implements SingletonInterface
->execute();
$pages = [];
while ($row = $result->fetch()) {
while ($row = $result->fetchAssociative()) {
$pages[$row['uid']] = $row;
}
......@@ -774,7 +774,7 @@ class WorkspaceService implements SingletonInterface
$permsClause
)
->execute();
while ($row = $statement->fetch()) {
while ($row = $statement->fetchAssociative()) {
if ($begin <= 0) {
$children[] = (int)$row['uid'];
}
......@@ -881,7 +881,7 @@ class WorkspaceService implements SingletonInterface
)
->setMaxResults(1)
->execute()
->fetch();
->fetchAssociative();
if ($row !== false) {
$isNewPage = VersionState::cast($row['t3ver_state'])->equals(VersionState::NEW_PLACEHOLDER);
......@@ -1032,7 +1032,7 @@ class WorkspaceService implements SingletonInterface
->execute();
$pageIds = [];
while ($row = $result->fetch()) {
while ($row = $result->fetchAssociative()) {
$pageIds[$row['pid']] = true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment