From 84eb9b78cd02adcdff13c6962fedf8d5c79cd705 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 17 Oct 2016 20:13:05 +0200 Subject: [PATCH] Fix saving conditions for boxes --- wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php b/wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php index 19fd944ec0..a86641f185 100644 --- a/wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/BoxEditForm.class.php @@ -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())) { -- 2.20.1