[BUGFIX] Fix 1-2-3(-4) wizard
authorHelmut Hummel <helmut.hummel@typo3.org>
Tue, 24 Jul 2012 18:27:00 +0000 (20:27 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Tue, 24 Jul 2012 20:47:44 +0000 (22:47 +0200)
Due to the localconf.php refactoring the
install wizard is broken. This change fixes it.

Change-Id: I1e266a76c5cdbee140df47fd61a09a14c72be9b6
Releases: 6.0
Resolves: #39112
Reviewed-on: http://review.typo3.org/13028
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
t3lib/class.t3lib_configuration.php
typo3/sysext/install/Resources/Private/Templates/StepOutput.html
typo3/sysext/install/mod/class.tx_install.php

index ed3f22f..c2524ae 100644 (file)
@@ -66,7 +66,9 @@ class t3lib_Configuration {
         */
        protected static $whiteListedLocalConfigurationPaths = array(
                'EXT/extConf',
-               'INSTALL/wizardDone'
+               'EXTCONF',
+               'INSTALL/wizardDone',
+               'DB',
        );
 
        /**
index d0c94c9..b874512 100644 (file)
                                <ol>
                                        <li class="t3-install-hidden">
                                                <input type="hidden" value="###STEP###" name="step" />
-                                               <input type="hidden" value="###ENCRYPTIONKEY###" name="TYPO3_INSTALL[localconf.php][encryptionKey]" />
-                                               <input type="hidden" value="###BRANCH###" name="TYPO3_INSTALL[localconf.php][compat_version]" />
+                                               <input type="hidden" value="###ENCRYPTIONKEY###" name="TYPO3_INSTALL[LocalConfiguration][encryptionKey]" />
+                                               <input type="hidden" value="###BRANCH###" name="TYPO3_INSTALL[LocalConfiguration][compat_version]" />
                                        </li>
                                        <li>
                                                <label for="t3-install-form-username">###LABELUSERNAME###</label>
-                                               <input id="t3-install-form-username" class="t3-install-form-input-text" type="text" value="###USERNAME###" name="TYPO3_INSTALL[localconf.php][typo_db_username]" />
+                                               <input id="t3-install-form-username" class="t3-install-form-input-text" type="text" value="###USERNAME###" name="TYPO3_INSTALL[Database][typo_db_username]" />
                                        </li>
                                        <li>
                                                <label for="t3-install-form-password">###LABELPASSWORD###</label>
-                                               <input id="t3-install-form-password" class="t3-install-form-input-text" type="password" value="###PASSWORD###" name="TYPO3_INSTALL[localconf.php][typo_db_password]" />
+                                               <input id="t3-install-form-password" class="t3-install-form-input-text" type="password" value="###PASSWORD###" name="TYPO3_INSTALL[Database][typo_db_password]" />
                                        </li>
                                        <li>
                                                <label for="t3-install-form-host">###LABELHOST###</label>
-                                               <input id="t3-install-form-host" class="t3-install-form-input-text" type="text" value="###HOST###" name="TYPO3_INSTALL[localconf.php][typo_db_host]" />
+                                               <input id="t3-install-form-host" class="t3-install-form-input-text" type="text" value="###HOST###" name="TYPO3_INSTALL[Database][typo_db_host]" />
                                        </li>
                                </ol>
                        </fieldset>
@@ -87,7 +87,7 @@
                                                <div>
                                                        <label for="t3-install-123-newdatabase">###LLOPTION1###</label>
                                                        <p>###LLREMARK1###</p>
-                                                       <input id="t3-install-123-newdatabase" class="t3-install-form-input-text" type="text" name="TYPO3_INSTALL[localconf.php][NEW_DATABASE_NAME]" ###FORMFIELDATTRIBUTESNEW### onfocus="document.getElementById('t3-install-form-db-select-new').checked=true" />
+                                                       <input id="t3-install-123-newdatabase" class="t3-install-form-input-text" type="text" name="TYPO3_INSTALL[Database][NEW_DATABASE_NAME]" ###FORMFIELDATTRIBUTESNEW### onfocus="document.getElementById('t3-install-form-db-select-new').checked=true" />
                                                        <!-- ###DATABASE_NAME_PATTERNS### begin -->
                                                        <p>###LL_DB_PATTERN_REMARK### <ul style="list-style:disc;">###LL_DB_PATTERN_LIST###</ul></p>
                                                        <!-- ###DATABASE_NAME_PATTERNS### end -->
@@ -98,7 +98,7 @@
                                                <div>
                                                        <label for="t3-install-123-database">###LLOPTION2###</label>
                                                        <p>###LLREMARK2###</p>
-                                                       <select id="t3-install-123-database" name="TYPO3_INSTALL[localconf.php][typo_db]" onfocus="document.getElementById('t3-install-form-db-select-existing').checked=true">
+                                                       <select id="t3-install-123-database" name="TYPO3_INSTALL[Database][typo_db]" onfocus="document.getElementById('t3-install-form-db-select-existing').checked=true">
                                                                <option value="">Select database</option>
                                                                <!-- ###DATABASEOPTIONS### begin -->
                                                                <option value="###DATABASEVALUE###" ###DATABASESELECTED###>###DATABASENAME###</option>
index 5f0c958..8de36e0 100644 (file)
@@ -3708,8 +3708,9 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                        break;
                        default:
 
-                               if (is_array($this->INSTALL['Database'])) {
+                               $localConfigurationPathValuePairs = array();
 
+                               if (is_array($this->INSTALL['Database'])) {
                                                // New database?
                                        if (trim($this->INSTALL['Database']['NEW_DATABASE_NAME'])) {
                                                $newDatabaseName = trim($this->INSTALL['Database']['NEW_DATABASE_NAME']);
@@ -3745,8 +3746,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                                                        case 'typo_db_username':
                                                                if (strlen($value) < 50) {
                                                                        if (strcmp(TYPO3_db_username, $value)) {
-                                                                               // @TODO: This is currently disabled and must be fixed before 6.0 final
-                                                                               //$this->setValueInLocalconfFile($lines, '$typo_db_username', trim($value));
+                                                                               $localConfigurationPathValuePairs['DB/username'] = $value;
                                                                        }
                                                                } else {
                                                                        $this->errorMessages[] = '
@@ -3758,8 +3758,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                                                        case 'typo_db_password':
                                                                if (strlen($value)<50) {
                                                                        if (strcmp(TYPO3_db_password, $value)) {
-                                                                               // @TODO: This is currently disabled and must be fixed before 6.0 final
-                                                                               //$this->setValueInLocalconfFile($lines, '$typo_db_password', trim($value));
+                                                                               $localConfigurationPathValuePairs['DB/password'] = $value;
                                                                        }
                                                                } else {
                                                                        $this->errorMessages[] = '
@@ -3770,8 +3769,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                                                        case 'typo_db_host':
                                                                if (preg_match('/^[a-zA-Z0-9_\.-]+(:.+)?$/', $value) && strlen($value)<50) {
                                                                        if (strcmp(TYPO3_db_host, $value)) {
-                                                                               // @TODO: This is currently disabled and must be fixed before 6.0 final
-                                                                               //$this->setValueInLocalconfFile($lines, '$typo_db_host', $value);
+                                                                               $localConfigurationPathValuePairs['DB/host'] = $value;
                                                                        }
                                                                } else {
                                                                        $this->errorMessages[] = '
@@ -3784,8 +3782,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                                                        case 'typo_db':
                                                                if (strlen($value)<50) {
                                                                        if (strcmp(TYPO3_db, $value)) {
-                                                                               // @TODO: This is currently disabled and must be fixed before 6.0 final
-                                                                               //$this->setValueInLocalconfFile($lines, '$typo_db', trim($value));
+                                                                               $localConfigurationPathValuePairs['DB/database'] = $value;
                                                                        }
                                                                } else {
                                                                        $this->errorMessages[] = '
@@ -3799,9 +3796,6 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                                }
 
                                if (is_array($this->INSTALL['LocalConfiguration'])) {
-
-                                       $localConfigurationPathValuePairs = array();
-
                                        foreach ($this->INSTALL['LocalConfiguration'] as $key => $value) {
 
                                                switch((string)$key) {
@@ -3870,14 +3864,17 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                                                // Hook to modify localconf.php lines in the 1-2-3 installer
                                        if (is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['writeLocalconf'])) {
                                                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['writeLocalconf'] as $classData) {
-                                                               // @TODO: Disabled for now. This is currently broken and must be fixed before 6.0 final
-                                                       //$hookObject = t3lib_div::getUserObj($classData);
-                                                       //$hookObject->executeWriteLocalconf($lines, $this->step, $this);
+                                                       $hookObject = t3lib_div::getUserObj($classData);
+                                                       $dummy = array();
+                                                       $hookObject->executeWriteLocalconf($dummy, $this->step, $this);
                                                }
                                        }
+                               }
 
-                                       t3lib_Configuration::setLocalConfigurationValuesByPathValuePairs($localConfigurationPathValuePairs);
+                               if (!empty($localConfigurationPathValuePairs)) {
+                                       $this->setLocalConfigurationValues($localConfigurationPathValuePairs);
                                }
+
                        break;
                }
                return $out;