From: mutec Date: Wed, 31 Jul 2019 20:55:31 +0000 (+0200) Subject: Fix applicationDirectory index during WSC-Updates X-Git-Tag: 5.2.0_RC_1~16^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2427a643577a102f693ad5f746c72b76a29ff537;p=GitHub%2FWoltLab%2FWCF.git Fix applicationDirectory index during WSC-Updates Some apps - including the WSC - do not provide an application directory within the package.xml-file. We have to check whether this index exists - otherwise we wouldn't need to prompt it at lines541ff. Not changing this behaviour will cause errors during the upgrade WSC 3.1 to WSC 5.2. --- diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index 8ea75049bb..8ce380a387 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -432,8 +432,11 @@ class PackageInstallationDispatcher { } unset($nodeData['requirements']); - $applicationDirectory = $nodeData['applicationDirectory']; - unset($nodeData['applicationDirectory']); + $applicationDirectory = ''; + if (isset($nodeData['applicationDirectory'])) { + $applicationDirectory = $nodeData['applicationDirectory']; + unset($nodeData['applicationDirectory']); + } // update package if ($this->queue->packageID) { @@ -534,15 +537,13 @@ class PackageInstallationDispatcher { } } - if ($this->getPackage()->isApplication && $this->getPackage()->package != 'com.woltlab.wcf' && $this->getAction() == 'install') { - if (empty($this->getPackage()->packageDir)) { - $document = $this->promptPackageDir($applicationDirectory); - if ($document !== null && $document instanceof FormDocument) { - $installationStep->setDocument($document); - } - - $installationStep->setSplitNode(); + if ($this->getPackage()->isApplication && $this->getPackage()->package != 'com.woltlab.wcf' && $this->getAction() == 'install' && empty($this->getPackage()->packageDir)) { + $document = $this->promptPackageDir($applicationDirectory); + if ($document !== null && $document instanceof FormDocument) { + $installationStep->setDocument($document); } + + $installationStep->setSplitNode(); } return $installationStep;