Skip to content

Commit

Permalink
Fix issue with DBfields getting invalid values assigned.
Browse files Browse the repository at this point in the history
  • Loading branch information
bummzack committed Jan 17, 2019
1 parent 9d1be07 commit 05715fa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion code/TranslatableFormFieldTransformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ public function transformFormField(FormField $field)
$fieldname = $field->getName();
if ($this->original->isLocalizedField($fieldname)) {
$field->setName($this->original->getLocalizedFieldName($fieldname));
$field->setValue($this->original->getLocalizedValue($fieldname));
$value = $this->original->getLocalizedValue($fieldname);
if ($value instanceof DBField) {
$field->setValue($value->getValue());
} else {
$field->setValue($value);
}
}

return $this->baseTransform($newfield, $field, $fieldname);
Expand Down

0 comments on commit 05715fa

Please sign in to comment.