Fix fetching templates for template listener PIP GUI
authorMatthias Schmidt <gravatronics@live.com>
Sat, 21 Jul 2018 09:11:03 +0000 (11:11 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 21 Jul 2018 09:11:03 +0000 (11:11 +0200)
See #2545

wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php

index f5f2a8b99c2ad4a04ab235d64f160b045786e9b8..a34bc23743858ac85cb768a08c562a5f4aba66d7 100644 (file)
@@ -161,7 +161,10 @@ class TemplateListenerPackageInstallationPlugin extends AbstractXMLPackageInstal
                $templateList = new TemplateList();
                $templateList->getConditionBuilder()->add(
                        'template.packageID IN (?)',
-                       [array_keys($this->installation->getPackage()->getAllRequiredPackages())]
+                       [array_merge(
+                               [$this->installation->getPackage()->packageID],
+                               array_keys($this->installation->getPackage()->getAllRequiredPackages())
+                       )]
                );
                $templateList->getConditionBuilder()->add('template.templateGroupID IS NULL');
                $templateList->sqlOrderBy = 'template.templateName ASC';
@@ -172,7 +175,10 @@ class TemplateListenerPackageInstallationPlugin extends AbstractXMLPackageInstal
                $acpTemplateList = new ACPTemplateList();
                $acpTemplateList->getConditionBuilder()->add(
                        'acp_template.packageID IN (?)',
-                       [array_keys($this->installation->getPackage()->getAllRequiredPackages())]
+                       [array_merge(
+                               [$this->installation->getPackage()->packageID],
+                               array_keys($this->installation->getPackage()->getAllRequiredPackages())
+                       )]
                );
                $acpTemplateList->sqlOrderBy = 'acp_template.templateName ASC';
                $acpTemplateList->readObjects();