Fixed 2 errors that prevented the installation of standalone application
authorMatthias Schmidt <gravatronics@live.com>
Fri, 5 Aug 2011 09:33:12 +0000 (11:33 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 5 Aug 2011 09:33:12 +0000 (11:33 +0200)
`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.

wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php
wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php

index 18e97a259de69d55b807d718ade41d5bf0f6854d..6b11000cc543c01f77f9e08d3f74f193112f3b73 100644 (file)
@@ -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
                        ))
index 95f34223a456ece0a502534ea1ffaaabb9a8de6e..5ee4743a65da541d20c4de1d6928f82845eb0316 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\system\package\plugin;
+use wcf\data\package\Package;
 use wcf\system\package\PackageInstallationSQLParser;
 use wcf\system\exception\SystemException;
 use wcf\system\WCF;
@@ -37,7 +38,7 @@ class SQLPackageInstallationPlugin extends AbstractPackageInstallationPlugin {
                        
                        if ($package->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.