From: Matthias Schmidt Date: Tue, 16 Oct 2018 18:23:40 +0000 (+0200) Subject: Fix validation of core object class name via GUI X-Git-Tag: 5.2.0_Alpha_1~617 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=345efefbe15def8eefe2e2317317419eda7a85c0;p=GitHub%2FWoltLab%2FWCF.git Fix validation of core object class name via GUI See #2545 --- 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(