From: Alexander Ebert Date: Tue, 28 Jan 2014 17:37:11 +0000 (+0100) Subject: Fixed package search without available update servers X-Git-Tag: 2.0.2_pl_1~7 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9a638517f412f40606ac976668a3d984240ccbfb;p=GitHub%2FWoltLab%2FWCF.git Fixed package search without available update servers --- diff --git a/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php b/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php index b617e8ba8d..e9474b38d5 100644 --- a/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php +++ b/wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php @@ -68,6 +68,20 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction { PackageUpdateDispatcher::getInstance()->refreshPackageDatabase(); $availableUpdateServers = PackageUpdateServer::getActiveUpdateServers(); + // there are no available package update servers + if (empty($availableUpdateServers)) { + WCF::getTPL()->assign(array( + 'packageUpdates' => array() + )); + + return array( + 'count' => 0, + 'pageCount' => 0, + 'searchID' => 0, + 'template' => WCF::getTPL()->fetch('packageSearchResultList') + ); + } + $conditions = new PreparedStatementConditionBuilder(); $conditions->add("package_update.packageUpdateServerID IN (?)", array(array_keys($availableUpdateServers))); if (!empty($this->parameters['package'])) {