Skip to content
Browse files

Merge branch 'hotfix/2438' into develop

Forward port #2438
  • Loading branch information...
2 parents b8bd3c9 + be4f91d commit b243c1c01d7d7fbf8c0a74eaf7c2f64dcb01b394 @weierophinney weierophinney committed
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
View
4 library/Zend/Form/Element/MultiCheckbox.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());
}
View
13 library/Zend/Form/Element/Select.php
@@ -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 b243c1c

Please sign in to comment.
Something went wrong with that request. Please try again.