From 345efefbe15def8eefe2e2317317419eda7a85c0 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Tue, 16 Oct 2018 20:23:40 +0200 Subject: [PATCH] Fix validation of core object class name via GUI See #2545 --- .../plugin/CoreObjectPackageInstallationPlugin.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/package/plugin/CoreObjectPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/CoreObjectPackageInstallationPlugin.class.php index ac3be5f5d4..2b93cb7b38 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/CoreObjectPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/CoreObjectPackageInstallationPlugin.class.php @@ -107,7 +107,13 @@ class CoreObjectPackageInstallationPlugin extends AbstractXMLPackageInstallation $this->editedEntry->getElementsByTagName('objectname')->item(0)->nodeValue !== $formField->getValue() ) { $coreObjectList = new CoreObjectList(); - $coreObjectList->getConditionBuilder()->add('objectName <> ?', [$formField->getValue()]); + $coreObjectList->getConditionBuilder()->add('objectName = ?', [$formField->getValue()]); + $coreObjectList->getConditionBuilder()->add('packageID IN (?)', [ + array_merge( + [$this->installation->getPackage()->packageID], + array_keys($this->installation->getPackage()->getAllRequiredPackages()) + ) + ]); if ($coreObjectList->countObjects() > 0) { $formField->addValidationError( -- 2.20.1