From 61161a6f8d1b85b3dc4e0fc15d2b221319f05d6a Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 9 Jun 2018 16:02:28 +0200 Subject: [PATCH] Fix XSD filename in newly created ACL option PIP files See #2545 --- .../TXmlGuiPackageInstallationPlugin.class.php | 15 +++++++++++++-- .../ACLOptionPackageInstallationPlugin.class.php | 8 ++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/devtools/pip/TXmlGuiPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/devtools/pip/TXmlGuiPackageInstallationPlugin.class.php index a8716458f6..fff75c7fad 100644 --- a/wcfsetup/install/files/lib/system/devtools/pip/TXmlGuiPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/devtools/pip/TXmlGuiPackageInstallationPlugin.class.php @@ -156,8 +156,7 @@ trait TXmlGuiPackageInstallationPlugin { * @return string */ protected function getEmptyXml(): string { - $classNamePieces = explode('\\', get_class($this)); - $xsdFilename = lcfirst(str_replace('PackageInstallationPlugin', '', array_pop($classNamePieces))); + $xsdFilename = $this->getXsdFilename(); return << @@ -167,6 +166,18 @@ trait TXmlGuiPackageInstallationPlugin { XML; } + /** + * Returns the name of the xsd file for this package installation plugin + * (without the file extension). + * + * @return string + */ + protected function getXsdFilename(): string { + $classNamePieces = explode('\\', get_class($this)); + + return lcfirst(str_replace('PackageInstallationPlugin', '', array_pop($classNamePieces))); + } + /** * Returns a list of all pip entries of this pip. * diff --git a/wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php index 93992d1e18..567a4dbc24 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php @@ -500,6 +500,14 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati return sha1($elementData['objectType'] . '/' . $elementData['name']); } + /** + * @inheritDoc + * @since 3.2 + */ + protected function getXsdFilename(): string { + return 'aclOption'; + } + /** * @inheritDoc * @since 3.2 -- 2.20.1