Fixed bug #17282: Workspaces module get placed on "top" of all Web> modules if sysext...
authorErnesto Baschny <ernst@cron-it.de>
Tue, 25 Jan 2011 00:38:28 +0000 (00:38 +0000)
committerErnesto Baschny <ernst@cron-it.de>
Tue, 25 Jan 2011 00:38:28 +0000 (00:38 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10289 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_extmgm.php

index 1767123..810ce4a 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2011-01-24  Ernesto Baschny  <ernst@cron-it.de>
 
+       * Fixed bug #17282: Workspaces module get placed on "top" of all Web> modules if sysext "info" is uninstalled (positioning relative to uninstalled sysext not working as documented)
        * Fixed issue #17260: Installation of version/workspaces cannot be skipped in migration wizard (Thanks to Francois Suter)
        * Fixed bug #17215: TCEFORM.tt_content.colPos.removeItems not working correctly on colPos with new backend layouts (Thanks to Jo Hasenau)
 
index 75e8f66..d91b24b 100644 (file)
@@ -705,17 +705,24 @@ final class t3lib_extMgm {
                                        case 'after':
                                        case 'before':
                                                $pointer = 0;
+                                               $found = FALSE;
                                                foreach ($mods as $k => $m) {
                                                        if (!strcmp($m, $modRef)) {
                                                                $pointer = strtolower($place) == 'after' ? $k + 1 : $k;
+                                                               $found = TRUE;
                                                        }
                                                }
-                                               array_splice(
-                                                       $mods, // The modules array
-                                                       $pointer, // To insert one position from the end of the list
-                                                       0, // Don't remove any items, just insert
-                                                       $sub // Module to insert
-                                               );
+                                               if ($found) {
+                                                       array_splice(
+                                                               $mods, // The modules array
+                                                               $pointer, // To insert one position from the end of the list
+                                                               0, // Don't remove any items, just insert
+                                                               $sub // Module to insert
+                                                       );
+                                               } else {
+                                                               // If requested module is not found: Add at the end
+                                                       array_push($mods, $sub);
+                                               }
                                        break;
                                        default:
                                                if (strtolower($place) == 'top') {