Fix validation of core object class name via GUI
authorMatthias Schmidt <gravatronics@live.com>
Tue, 16 Oct 2018 18:23:40 +0000 (20:23 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 16 Oct 2018 18:23:40 +0000 (20:23 +0200)
See #2545

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

index ac3be5f5d4d976451f868f883be7d656f596e7b8..2b93cb7b38e2584d40c14be3d13041afe7b661e9 100644 (file)
@@ -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(