Fix saving conditions for boxes
authorMatthias Schmidt <gravatronics@live.com>
Mon, 17 Oct 2016 18:13:05 +0000 (20:13 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 17 Oct 2016 18:13:05 +0000 (20:13 +0200)
wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php

index 19fd944ec087457e1654a316a2d7eca1c4ce3584..a86641f1856be28e09f5c11ef91d463031b1036d 100644 (file)
@@ -119,9 +119,11 @@ class BoxEditForm extends BoxAddForm {
                $this->objectAction->executeAction();
                
                // delete old conditions
-               if ($this->box->getController() && $this->box->getController() instanceof IConditionBoxController) {
+               if ($this->box->objectTypeID) {
+                       $className = ObjectTypeCache::getInstance()->getObjectType($this->box->objectTypeID)->className;
+                       
                        /** @var IConditionBoxController $oldController */
-                       $oldController = $this->box->getController();
+                       $oldController = new $className;
                        
                        /** @noinspection PhpUndefinedMethodInspection */
                        if ($oldController->getConditionDefinition() && (!$this->boxController || (!($this->boxController->getProcessor() instanceof IConditionBoxController)) || !$this->boxController->getProcessor()->getConditionDefinition())) {