From 1fa0ca0c7baea97b833d55ad1fc97cdc846e45ac Mon Sep 17 00:00:00 2001 From: czhDavid Date: Fri, 11 Apr 2014 09:50:18 +0200 Subject: [PATCH] Update DependentSelectBox.php Fixed error when no values have been loaded and attempting to set empty value --- src/DependentSelectBox/DependentSelectBox.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/DependentSelectBox/DependentSelectBox.php b/src/DependentSelectBox/DependentSelectBox.php index 12f3b3e..1e352b3 100644 --- a/src/DependentSelectBox/DependentSelectBox.php +++ b/src/DependentSelectBox/DependentSelectBox.php @@ -123,6 +123,7 @@ public function setValue($value, $refreshTree = true) { if($value !== null && !$this->hasEmptyValue() && $this->hasAnyParentEmptyValue()) { throw new LogicException("Cant set value of dependent component when parent have no value ! (Control: '$this->name')"); } + if($value != '') parent::setValue($value); if($refreshTree && !$this->hasEmptyValue()) $this->refresh(false);