Even more debugging output :/
authorAlexander Ebert <ebert@woltlab.com>
Fri, 16 Mar 2012 15:12:47 +0000 (16:12 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 16 Mar 2012 15:12:47 +0000 (16:12 +0100)
See #433

wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php

index 1a8a51db3d8256059da1f7e0911cd49273ba70e9..80c4b84585de1954b2472dfab32370530f0c8495 100755 (executable)
@@ -89,21 +89,25 @@ class InstallPackageAction extends AbstractDialogAction {
                                $this->installation->completeSetup();
                                $this->finalize();
                                
-                               // redirect to application if not already within one
-                               if (PACKAGE_ID == 1) {
-                                       // select first installed application
-                                       $sql = "SELECT          packageID
-                                               FROM            wcf".WCF_N."_package
-                                               WHERE           packageID <> 1
-                                                               AND isApplication = 1
-                                               ORDER BY        installDate ASC";
-                                       $statement = WCF::getDB()->prepareStatement($sql, 1);
-                                       $statement->execute();
-                                       $row = $statement->fetchArray();
-                                       $packageID = ($row === false) ? 1 : $row['packageID'];
-                               }
-                               else {
-                                       $packageID = PACKAGE_ID;
+                               switch (PACKAGE_ID) {
+                                       // redirect to application if not already within one
+                                       case 0: // during WCFSetup
+                                       case 1:
+                                               // select first installed application
+                                               $sql = "SELECT          packageID
+                                                       FROM            wcf".WCF_N."_package
+                                                       WHERE           packageID <> 1
+                                                                       AND isApplication = 1
+                                                       ORDER BY        installDate ASC";
+                                               $statement = WCF::getDB()->prepareStatement($sql, 1);
+                                               $statement->execute();
+                                               $row = $statement->fetchArray();
+                                               $packageID = ($row === false) ? 1 : $row['packageID'];
+                                       break;
+                                       
+                                       default:
+                                               $packageID = PACKAGE_ID;
+                                       break;
                                }
                                        
                                // get domain path
@@ -116,7 +120,7 @@ class InstallPackageAction extends AbstractDialogAction {
                                
                                // build redirect location
                                $location = $row['domainName'] . $row['domainPath'] . 'acp/index.php/PackageList/' . SID_ARG_1ST;
-                               @file_put_contents(WCF_DIR . '__installPackage.txt', $row['domainName'] . "\n" . $row['domainPath'] . "\n" . $location);
+                               @file_put_contents(WCF_DIR . '__installPackage.txt', "packageID = ".PACKAGE_ID ."\n" . $row['domainName'] . "\n" . $row['domainPath'] . "\n" . $location);
                                
                                // show success
                                $this->data = array(