[BUGFIX] Upgrade wizard fails if no deprecated properties are found
authorStanislas Rolland <typo3@sjbr.ca>
Sat, 30 Jul 2011 16:44:32 +0000 (12:44 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Sat, 30 Jul 2011 17:13:06 +0000 (19:13 +0200)
Upgrade Wizard "Deprecated RTE properties in Page TS Config" fails
when no deprecated properties are used at all.

Make it a success, but keep the information message.

Change-Id: I0e0919cc02536a12d84da3d37cea64afe3af12e3
Resolves: #28593
Releases: 4.6
Reviewed-on: http://review.typo3.org/3908
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
typo3/sysext/rtehtmlarea/hooks/install/class.tx_rtehtmlarea_deprecatedrteproperties.php

index a77e960..1fd5352 100644 (file)
@@ -148,19 +148,24 @@ class tx_rtehtmlarea_deprecatedRteProperties extends Tx_Install_Updates_Base {
         * @return      boolean         TRUE if update succeeded, FALSE otherwise
         */
        public function performUpdate(&$dbQueries, &$customMessages) {
+               $success = FALSE;
                $pages = $this->getPagesWithDeprecatedRteProperties($dbQueries, $customMessages);
-               if (count($pages)) {
-                       $updateablePages = $this->findUpdateablePagesWithDeprecatedRteProperties($pages);
-                       if (count($updateablePages)) {
-                               $this->updatePages($updateablePages, $dbQueries, $customMessages);
+               if (empty($customMessages)) {
+                       if (count($pages)) {
+                               $updateablePages = $this->findUpdateablePagesWithDeprecatedRteProperties($pages);
+                               if (count($updateablePages)) {
+                                       $this->updatePages($updateablePages, $dbQueries, $customMessages);
+                               } else {
+                                       $customMessages = '<p>Some deprecated Page TS Config properties were found. However, the wizard was unable to automatically replace any of the deprecated properties found. They will have to be replaced manually.</p>';
+                                       $success = TRUE;
+                               }
                        } else {
-                               $customMessages = '<p>The wizard was unable to automatically replace any of the deprecated Page TS Config properties used. They will have to be replaced manually.</p>';
+                               $customMessages = '<p>No deprecated Page TS Config properties were found on page records.</p>' . LF .
+                                       '<p>Note that Page TS Config may be included from external files. These were not updated by this wizard. If required, the update will need to be done manually.</p>';
+                               $success = TRUE;
                        }
-               } else {
-                       $customMessages = '<p>No deprecated Page TS Config properties were found on page records.</p>' . LF .
-                               '<p>Note that Page TS Config may be included from external files. These were not updated by this wizard. If required, the update will need to be done manually.</p>';
                }
-               return empty($customMessages);
+               return empty($customMessages) || $success;
        }
 
        /**