[BUGFIX] dbal: Always initialize the DBMS specifics 35/40135/2
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Tue, 9 Jun 2015 18:37:35 +0000 (20:37 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Wed, 17 Jun 2015 21:43:30 +0000 (23:43 +0200)
Make default DBMS specifics available when no DBAL handler has
been configured to fix errors in the install tool.

Resolves: #67380
Releases: master
Change-Id: I8140fbe570628a5747e21a6e07920b8fbdc820b1
Reviewed-on: http://review.typo3.org/40135
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/dbal/Classes/Database/DatabaseConnection.php

index 2f64c7f..c1b865a 100644 (file)
@@ -233,6 +233,8 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
                if (isset($this->conf['table2handlerKeys'])) {
                        $this->table2handlerKeys = $this->conf['table2handlerKeys'];
                }
+
+               $specificsClassName = Specifics\NullSpecifics::class;
                if (isset($this->conf['handlerCfg'])) {
                        $this->handlerCfg = $this->conf['handlerCfg'];
 
@@ -244,12 +246,11 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
                                        if (!is_subclass_of($className, Specifics\AbstractSpecifics::class)) {
                                                throw new \InvalidArgumentException($className . ' must inherit from ' . Specifics\AbstractSpecifics::class, 1416919866);
                                        }
-                               } else {
-                                       $className = Specifics\NullSpecifics::class;
+                                       $specificsClassName = $className;
                                }
-                               $this->dbmsSpecifics = GeneralUtility::makeInstance($className);
                        }
                }
+               $this->dbmsSpecifics = GeneralUtility::makeInstance($specificsClassName);
                $this->cacheFieldInfo();
                // Debugging settings:
                $this->printErrors = !empty($this->conf['debugOptions']['printErrors']);