Attempt to fix applications during package installation
authorAlexander Ebert <ebert@woltlab.com>
Sun, 27 Jan 2013 04:43:46 +0000 (05:43 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 27 Jan 2013 04:43:46 +0000 (05:43 +0100)
wcfsetup/install/files/lib/system/application/ApplicationHandler.class.php

index b0bea841c5db1112ae5c9e2ca4bfcbf738e41d0c..458df83eacf3838017186efe8abc6343f6c2327e 100644 (file)
@@ -108,11 +108,12 @@ class ApplicationHandler extends SingletonFactory {
         * @return      array<wcf\data\application\Application>
         */
        public function getDependentApplications() {
-               $applications = array();
-               foreach ($this->cache['application'] as $packageID => $application) {
-                       if ($packageID == PACKAGE_ID) continue;
-                       
-                       $applications[] = $application;
+               $applications = $this->getApplications();
+               foreach ($applications as $key => $application) {
+                       if ($application->packageID == $this->getActiveApplication()->packageID) {
+                               unset($applications[$key]);
+                               break;
+                       }
                }
                
                return $applications;
@@ -124,10 +125,7 @@ class ApplicationHandler extends SingletonFactory {
         * @return      array<wcf\data\application\Application>
         */
        public function getApplications() {
-               $applications = $this->getDependentApplications();
-               $applications[] = $this->getActiveApplication();
-               
-               return $applications;
+               return $this->cache['application'];
        }
        
        /**