Fix applicationDirectory index during WSC-Updates
authormutec <mutec@users.noreply.github.com>
Wed, 31 Jul 2019 20:55:31 +0000 (22:55 +0200)
committermutec <mysterycode@mysterycode.de>
Wed, 31 Jul 2019 21:06:52 +0000 (23:06 +0200)
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.

wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php

index 8ea75049bba00925f65202b4f6e4ba163b8d1aa3..8ce380a3875374ef3cad147b694217b4f4b941e6 100644 (file)
@@ -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;