From b68f0af4378647df83e713f2ad15288b6db39695 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 5 Aug 2011 11:33:12 +0200 Subject: [PATCH] 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. --- .../system/package/PackageInstallationNodeBuilder.class.php | 4 ++-- .../package/plugin/SQLPackageInstallationPlugin.class.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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. -- 2.20.1