From: Matthias Schmidt Date: Fri, 5 Aug 2011 09:33:12 +0000 (+0200) Subject: Fixed 2 errors that prevented the installation of standalone application X-Git-Tag: 2.0.0_Beta_1~1902^2~4^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b68f0af4378647df83e713f2ad15288b6db39695;p=GitHub%2FWoltLab%2FWCF.git Fixed 2 errors that prevented the installation of standalone application `PackageInstallationNodeBuilder::buildPackageNode()` didn't handle non-existing `packageDescription` and `authorURL` tags (which may be omitted according to the `package.xsd` file) so that they were set to null which caused problems later when `PackageInstallationDispatcher::installPackage()` is called and tries to save that node data since the database table columns `packageDescription` and `authorURL` may not be null. Also the `SQLPackageInstallationPlugin::install()` method called `Package::getAbbreviation()` the wrong way. --- diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php index 18e97a259d..6b11000cc5 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php @@ -319,13 +319,13 @@ class PackageInstallationNodeBuilder { 'package' => $this->installation->getArchive()->getPackageInfo('name'), 'packageName' => $this->installation->getArchive()->getPackageInfo('packageName'), 'instanceNo' => $instanceNo, - 'packageDescription' => $this->installation->getArchive()->getPackageInfo('packageDescription'), + 'packageDescription' => $this->installation->getArchive()->getPackageInfo('packageDescription') !== null ? $this->installation->getArchive()->getPackageInfo('packageDescription') : '', 'packageVersion' => $this->installation->getArchive()->getPackageInfo('version'), 'packageDate' => $this->installation->getArchive()->getPackageInfo('date'), 'packageURL' => $this->installation->getArchive()->getPackageInfo('packageURL'), 'standalone' => $this->installation->getArchive()->getPackageInfo('standalone'), 'author' => $this->installation->getArchive()->getAuthorInfo('author'), - 'authorURL' => $this->installation->getArchive()->getAuthorInfo('authorURL'), + 'authorURL' => $this->installation->getArchive()->getAuthorInfo('authorURL') !== null ? $this->installation->getArchive()->getAuthorInfo('authorURL') : '', 'installDate' => TIME_NOW, 'updateDate' => TIME_NOW )) diff --git a/wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php index 95f34223a4..5ee4743a65 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php @@ -1,5 +1,6 @@ standalone == 1) { // package is standalone - $packageAbbr = $package->getAbbreviation(); + $packageAbbr = Package::getAbbreviation($package->package); $tablePrefix = WCF_N.'_'.$package->instanceNo.'_'; // Replace the variable xyz1_1 with $tablePrefix in the table names.