Fixed issue #17320: Not installing extensions in Upgrade Wizard should also get rid...
authorErnesto Baschny <ernst@cron-it.de>
Wed, 26 Jan 2011 01:16:25 +0000 (01:16 +0000)
committerErnesto Baschny <ernst@cron-it.de>
Wed, 26 Jan 2011 01:16:25 +0000 (01:16 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10318 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/install/Classes/Updates/Base.php
typo3/sysext/install/updates/class.tx_coreupdates_installnewsysexts.php
typo3/sysext/install/updates/class.tx_coreupdates_installsysexts.php

index b4f4665..d6343fe 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
 
 2011-01-25  Ernesto Baschny  <ernst@cron-it.de>
 
+       * Fixed issue #17320: Not installing extensions in Upgrade Wizard should also get rid of the wizard
        * Fixed issue #16712: Cleanup: centralize TYPO3 urls (Thanks to Steffen Kamper)
        * Fixed issue #16142: Records should not be indented if there is no parent record (Thanks to Georg Ringer)
        * Fixed issue #17316: Flag sprites was not updated after renaming canada.gif back to ca.gif and "multi-language" was missing
index 9dbc02f..b255d81 100644 (file)
@@ -220,5 +220,38 @@ abstract class Tx_Install_Updates_Base {
                }
        }
 
+       /**
+        * Marks some wizard as being "seen" so that it not shown again.
+        *
+        * Writes the info in localconf.php
+        *
+        * @return void
+        */
+       protected function markWizardAsDone() {
+               /** @var t3lib_install $install */
+               $install = t3lib_div::makeInstance('t3lib_install');
+               $install->allowUpdateLocalConf = 1;
+               $install->updateIdentity = 'TYPO3 Upgrade Wizard';
+               // Get lines from localconf file
+               $lines = $install->writeToLocalconf_control();
+               $wizardClassName = get_class($this);
+               $install->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'INSTALL\'][\'wizardDone\'][\'' . $wizardClassName . '\']', 1);
+               $install->writeToLocalconf_control($lines);
+       }
+
+       /**
+        * Checks if this wizard has been "done" before
+        *
+        * @return boolean TRUE if wizard has been done before, FALSE otherwise
+        */
+       protected function isWizardDone() {
+               $wizardClassName = get_class($this);
+               $done = FALSE;
+               if (isset($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone'][$wizardClassName]) &&
+                       $GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone'][$wizardClassName]) {
+                       $done = TRUE;
+               }
+               return $done;
+       }
 }
 ?>
index 040d6c0..aa5275e 100644 (file)
@@ -45,7 +45,7 @@ class tx_coreupdates_installnewsysexts extends Tx_Install_Updates_Base {
         * @return      boolean         whether an update is needed (true) or not (false)
         */
        public function checkForUpdate(&$description) {
-               $result = false;
+               $result = FALSE;
                $description = '
                        <p>
                                Install the following system extensions that are new in TYPO3
@@ -72,13 +72,16 @@ class tx_coreupdates_installnewsysexts extends Tx_Install_Updates_Base {
                                        </li>
                                ';
 
-                               $result = true;
+                               $result = TRUE;
                        }
                }
 
                $description .= '
                        </ul>
                ';
+               if ($this->isWizardDone()) {
+                       $result = FALSE;
+               }
 
                return $result;
        }
@@ -134,7 +137,6 @@ class tx_coreupdates_installnewsysexts extends Tx_Install_Updates_Base {
         * @return      boolean         whether it worked (true) or not (false)
         */
        public function performUpdate(&$dbQueries, &$customMessages) {
-               $result = FALSE;
 
                        // Get extension keys that were submitted by the user to be installed and that are valid for this update wizard
                if (is_array($this->pObj->INSTALL['update']['installNewSystemExtensions']['sysext'])) {
@@ -143,10 +145,12 @@ class tx_coreupdates_installnewsysexts extends Tx_Install_Updates_Base {
                                array_keys($this->pObj->INSTALL['update']['installNewSystemExtensions']['sysext'])
                        );
                        $this->installExtensions($extArray);
-                       $result = TRUE;
                }
 
-               return $result;
+                       // Never show this wizard again
+               $this->markWizardAsDone();
+
+               return TRUE;
        }
 
 
index b0498b7..9f23757 100644 (file)
@@ -45,7 +45,7 @@ class tx_coreupdates_installsysexts extends Tx_Install_Updates_Base {
         * @return      boolean         whether an update is needed (true) or not (false)
         */
        public function checkForUpdate(&$description) {
-               $result = false;
+               $result = FALSE;
                $description = '
                        <p>
                                Install the following system extensions as their functionality
@@ -107,9 +107,12 @@ class tx_coreupdates_installsysexts extends Tx_Install_Updates_Base {
 
                foreach($this->newSystemExtensions as $ext) {
                        if (!t3lib_extMgm::isLoaded($ext)) {
-                               $result = true;
+                               $result = TRUE;
                        }
                }
+               if ($this->isWizardDone()) {
+                       $result = FALSE;
+               }
                return $result;
        }
 
@@ -179,7 +182,6 @@ class tx_coreupdates_installsysexts extends Tx_Install_Updates_Base {
         * @return      boolean         whether it worked (true) or not (false)
         */
        public function performUpdate(&$dbQueries, &$customMessages) {
-               $result = FALSE;
 
                        // Get extension keys that were submitted by the user to be installed and that are valid for this update wizard
                if (is_array($this->pObj->INSTALL['update']['installSystemExtensions']['sysext'])) {
@@ -188,10 +190,12 @@ class tx_coreupdates_installsysexts extends Tx_Install_Updates_Base {
                                array_keys($this->pObj->INSTALL['update']['installSystemExtensions']['sysext'])
                        );
                        $this->installExtensions($extArray);
-                       $result = TRUE;
                }
 
-               return $result;
+                       // Never show this wizard again
+               $this->markWizardAsDone();
+
+               return TRUE;
        }
 
        /**