Permalink
Browse files

Merge branch 'hotfix/2438' into develop

Forward port #2438
  • Loading branch information...
weierophinney committed Oct 2, 2012
2 parents eaca3c3 + b92fb11 commit 626f74fe4895fb22dcb3220cb9752618de418899
Showing with 13 additions and 4 deletions.
  1. +2 −2 library/Zend/Form/Element/MultiCheckbox.php
  2. +11 −2 library/Zend/Form/Element/Select.php
@@ -63,8 +63,8 @@ public function setValueOptions(array $options)
{
$this->valueOptions = $options;
- // Update InArray validator haystack
- if (!is_null($this->validator)) {
+ // Update Explode validator haystack
+ if ($this->validator instanceof ExplodeValidator) {
$validator = $this->validator->getValidator();
$validator->setHaystack($this->getValueOptionsValues());
}
@@ -83,8 +83,17 @@ public function setValueOptions(array $options)
// Update InArrayValidator validator haystack
if (!is_null($this->validator)) {
- $validator = $this->validator instanceof InArrayValidator ? $this->validator : $this->validator->getValidator();
- $validator->setHaystack($this->getValueOptionsValues());
+ if ($this->validator instanceof InArrayValidator){
+ $validator = $this->validator;
+ }
+ if ($this->validator instanceof ExplodeValidator
+ && $this->validator->getValidator() instanceof InArrayValidator
+ ){
+ $validator = $this->validator->getValidator();
+ }
+ if (!empty($validator)){
+ $validator->setHaystack($this->getValueOptionsValues());
+ }
}
return $this;

0 comments on commit 626f74f

Please sign in to comment.