From 92bcab67819b309ae5ee7921077098a2b880283a Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 13 Oct 2018 15:06:28 +0200 Subject: [PATCH] Use `tagName` when creating new PIP entry See #2545 --- .../plugin/ACPSearchProviderPackageInstallationPlugin.class.php | 2 +- .../package/plugin/CronjobPackageInstallationPlugin.class.php | 2 +- .../package/plugin/MenuItemPackageInstallationPlugin.class.php | 2 +- .../ObjectTypeDefinitionPackageInstallationPlugin.class.php | 2 +- .../plugin/ObjectTypePackageInstallationPlugin.class.php | 2 +- .../package/plugin/PIPPackageInstallationPlugin.class.php | 2 +- .../package/plugin/PagePackageInstallationPlugin.class.php | 2 +- .../plugin/UserProfileMenuPackageInstallationPlugin.class.php | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php index 5530eecbf1..181c86ade5 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php @@ -236,7 +236,7 @@ class ACPSearchProviderPackageInstallationPlugin extends AbstractXMLPackageInsta protected function writeEntry(\DOMDocument $document, IFormDocument $form) { $data = $form->getData()['data']; - $acpSearchProvider = $document->createElement('acpsearchprovider'); + $acpSearchProvider = $document->createElement($this->tagName); $acpSearchProvider->setAttribute('name', $data['name']); $acpSearchProvider->appendChild($document->createElement('classname', $data['classname'])); diff --git a/wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php index 2ea5623b0e..e4351397cb 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php @@ -357,7 +357,7 @@ class CronjobPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu $data = $form->getData(); $formData = $form->getData()['data']; - $cronjob = $document->createElement('cronjob'); + $cronjob = $document->createElement($this->tagName); $cronjob->setAttribute('name', $formData['name']); $className = $document->createElement('classname', $formData['classname']); diff --git a/wcfsetup/install/files/lib/system/package/plugin/MenuItemPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/MenuItemPackageInstallationPlugin.class.php index f6f81e36cc..5baca1fec8 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/MenuItemPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/MenuItemPackageInstallationPlugin.class.php @@ -551,7 +551,7 @@ class MenuItemPackageInstallationPlugin extends AbstractXMLPackageInstallationPl $formData = $form->getData(); $data = $formData['data']; - $menuItem = $document->createElement('item'); + $menuItem = $document->createElement($this->tagName); $menuItem->setAttribute('identifier', $data['identifier']); if (!empty($data['menu'])) { diff --git a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php index 0e5c16ef86..0362ac6b96 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php @@ -228,7 +228,7 @@ class ObjectTypeDefinitionPackageInstallationPlugin extends AbstractXMLPackageIn protected function writeEntry(\DOMDocument $document, IFormDocument $form) { $data = $form->getData()['data']; - $definition = $document->createElement('definition'); + $definition = $document->createElement($this->tagName); $definition->appendChild($document->createElement('name', $data['name'])); if (!empty($data['interfacename'])) { diff --git a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php index 855dec3707..4670abd149 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php @@ -727,7 +727,7 @@ XML; * @since 3.2 */ protected function writeEntry(\DOMDocument $document, IFormDocument $form) { - $type = $document->createElement('type'); + $type = $document->createElement($this->tagName); foreach ($form->getData()['data'] as $key => $value) { if ($key === 'definitionID') { $key = 'definitionname'; diff --git a/wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php index f06623e5da..7202fe7ec6 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php @@ -203,7 +203,7 @@ class PIPPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin /** @var TextFormField $pluginName */ $pluginName = $form->getNodeById('pluginName'); - $pip = $document->createElement('pip', $className->getSaveValue()); + $pip = $document->createElement($this->tagName, $className->getSaveValue()); $pip->setAttribute('name', $pluginName->getSaveValue()); $document->getElementsByTagName('import')->item(0)->appendChild($pip); diff --git a/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php index 9a129f9738..393f400bbe 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php @@ -772,7 +772,7 @@ class PagePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin $formData = $form->getData(); $data = $formData['data']; - $page = $document->createElement('page'); + $page = $document->createElement($this->tagName); $page->setAttribute('identifier', $data['identifier']); $page->appendChild($document->createElement('pageType', $data['pageType'])); diff --git a/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php index 1b4d64fe2d..c6203cfa18 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php @@ -251,7 +251,7 @@ class UserProfileMenuPackageInstallationPlugin extends AbstractXMLPackageInstall protected function writeEntry(\DOMDocument $document, IFormDocument $form) { $data = $form->getData()['data']; - $userProfileMenuItem = $document->createElement('userprofilemenuitem'); + $userProfileMenuItem = $document->createElement($this->tagName); $userProfileMenuItem->setAttribute('name', $data['name']); $userProfileMenuItem->appendChild($document->createElement('classname', $data['classname'])); -- 2.20.1