Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/2438' into develop
Browse files Browse the repository at this point in the history
Forward port #2438
  • Loading branch information
weierophinney committed Oct 2, 2012
2 parents b8bd3c9 + be4f91d commit b243c1c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions library/Zend/Form/Element/MultiCheckbox.php
Expand Up @@ -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());
}
Expand Down
13 changes: 11 additions & 2 deletions library/Zend/Form/Element/Select.php
Expand Up @@ -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;
Expand Down

0 comments on commit b243c1c

Please sign in to comment.