Fixed result if no matched package is accessible
authorAlexander Ebert <ebert@woltlab.com>
Thu, 12 Dec 2013 22:44:02 +0000 (23:44 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 12 Dec 2013 22:44:02 +0000 (23:44 +0100)
wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php

index 03e4cd83838e6a204def983781f6ff1635904503..b617e8ba8d612aea668132943a86e9affb50dd50 100644 (file)
@@ -246,6 +246,20 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                        );
                }
                
+               // no found packages is accessible
+               if (empty($packageUpdates)) {
+                       WCF::getTPL()->assign(array(
+                               'packageUpdates' => array()
+                       ));
+                       
+                       return array(
+                               'count' => 0,
+                               'pageCount' => 0,
+                               'searchID' => 0,
+                               'template' => WCF::getTPL()->fetch('packageSearchResultList')
+                       );
+               }
+               
                $search = SearchEditor::create(array(
                        'userID' => WCF::getUser()->userID,
                        'searchData' => serialize($packageUpdates),