[TASK] Doctrine: Migrate OpenidExtractionUpdate 43/49543/4
authorTobias Adolph <mail@tobiasadolph.de>
Mon, 22 Aug 2016 18:35:23 +0000 (20:35 +0200)
committerBenni Mack <benni@typo3.org>
Mon, 22 Aug 2016 19:02:53 +0000 (21:02 +0200)
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>
typo3/sysext/install/Classes/Updates/OpenidExtractionUpdate.php

index be4fe27..604fe93 100644 (file)
@@ -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) {