Skip to content

Commit

Permalink
Merge pull request #794 from creamarketing/ListboxField_Inconsistency
Browse files Browse the repository at this point in the history
FIX: ListBoxField and DropdownField should respect getSource()
  • Loading branch information
wilr committed Sep 14, 2012
2 parents 7a8c35f + 54d8abc commit 15f40af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion forms/DropdownField.php
Expand Up @@ -236,7 +236,7 @@ function getEmptyString() {
}

function performReadonlyTransformation() {
$field = new LookupField($this->name, $this->title, $this->source);
$field = new LookupField($this->name, $this->title, $this->getSource());
$field->setValue($this->value);
$field->setForm($this->form);
$field->setReadonly(true);
Expand Down
2 changes: 1 addition & 1 deletion forms/ListboxField.php
Expand Up @@ -224,7 +224,7 @@ function setValue($val, $obj = null) {
// They're silently ignored and overwritten the next time the field is saved.
parent::setValue($parts);
} else {
if(!in_array($val, array_keys($this->source))) {
if(!in_array($val, array_keys($this->getSource()))) {
throw new InvalidArgumentException(sprintf(
'Invalid value "%s" for multiple=false',
Convert::raw2xml($val)
Expand Down

0 comments on commit 15f40af

Please sign in to comment.