From 33e00a67976ef2305d3c173f0e92ff228495e6e0 Mon Sep 17 00:00:00 2001
From: Tobias Adolph <mail@tobiasadolph.de>
Date: Mon, 22 Aug 2016 20:35:23 +0200
Subject: [PATCH] [TASK] Doctrine: Migrate OpenidExtractionUpdate

Resolves: #77593
Releases: master
Change-Id: I4e6b483b5022cf54223a8f0cfad789d1ba7315fd
Reviewed-on: https://review.typo3.org/49543
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
---
 .../Classes/Updates/OpenidExtractionUpdate.php   | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/typo3/sysext/install/Classes/Updates/OpenidExtractionUpdate.php b/typo3/sysext/install/Classes/Updates/OpenidExtractionUpdate.php
index be4fe27aecdd..604fe93f50b2 100644
--- a/typo3/sysext/install/Classes/Updates/OpenidExtractionUpdate.php
+++ b/typo3/sysext/install/Classes/Updates/OpenidExtractionUpdate.php
@@ -14,6 +14,9 @@ namespace TYPO3\CMS\Install\Updates;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Database\ConnectionPool;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * Installs and downloads EXT:openid if needed
  */
@@ -53,12 +56,17 @@ class OpenidExtractionUpdate extends AbstractDownloadExtensionUpdate
         if (!$this->isWizardDone()) {
             $columnsExists = false;
 
-            $columns = $this->getDatabaseConnection()->admin_get_fields('fe_users');
-            if (isset($columns['tx_openid_openid'])) {
+            $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
+            $schemaManager = $connectionPool->getConnectionForTable('fe_users')->getSchemaManager();
+
+            if ($schemaManager->listTableDetails('fe_users')->hasColumn('tx_openid_openid')) {
                 $columnsExists = true;
             }
-            $columns = $this->getDatabaseConnection()->admin_get_fields('be_users');
-            if (isset($columns['tx_openid_openid'])) {
+
+            // Reinitialize schemaManager, since be_users could be on another connection
+            $schemaManager = $connectionPool->getConnectionForTable('be_users')->getSchemaManager();
+
+            if ($schemaManager->listTableDetails('be_users')->hasColumn('tx_openid_openid')) {
                 $columnsExists = true;
             }
             if ($columnsExists) {
-- 
GitLab