Show proper error message on pip pages of non-installed packages
authorMatthias Schmidt <gravatronics@live.com>
Sat, 28 Sep 2019 12:48:06 +0000 (14:48 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 28 Sep 2019 12:48:06 +0000 (14:48 +0200)
wcfsetup/install/files/lib/acp/form/DevtoolsProjectPipEntryAddForm.class.php
wcfsetup/install/files/lib/acp/page/DevtoolsProjectPipEntryListPage.class.php
wcfsetup/install/files/lib/data/devtools/project/DevtoolsProject.class.php

index 874ffe024e9d700b99bd1f597d5a4d573f7f5c61..3d98c5083789e43972b11566bbd24affc9553451 100644 (file)
@@ -78,7 +78,9 @@ class DevtoolsProjectPipEntryAddForm extends AbstractFormBuilderForm {
                        throw new IllegalLinkException();
                }
                
-               $this->project->validatePackageXml();
+               if ($this->project->validatePackageXml() !== '') {
+                       throw new IllegalLinkException();
+               }
                
                if (isset($_REQUEST['pip'])) $this->pip = StringUtil::trim($_REQUEST['pip']);
                
index 6ca1d61eeebdc3906fd26f05dd9ac6fc15fd482e..4297e4105345b00e6d8732e7e45d7421cfe354c7 100644 (file)
@@ -136,7 +136,9 @@ class DevtoolsProjectPipEntryListPage extends AbstractPage {
                        throw new IllegalLinkException();
                }
                
-               $this->project->validatePackageXml();
+               if ($this->project->validatePackageXml() !== '') {
+                       throw new IllegalLinkException();
+               }
                
                if (isset($_REQUEST['pip'])) $this->pip = StringUtil::trim($_REQUEST['pip']);
                
index 617c79555a3315f0916c088931d1dba12aa6b574..1602bebecc71c34e59cc52b73b30f5a966813dd2 100644 (file)
@@ -123,7 +123,7 @@ class DevtoolsProject extends DatabaseObject {
                
                if ($this->getPackage() === null) {
                        return WCF::getLanguage()->getDynamicVariable('wcf.acp.devtools.project.path.error.notInstalled', [
-                               'package' => $this->packageArchive->getPackageInfo('name')
+                               'project' => $this
                        ]);
                }