From cb6df8c4c4b62e3254f8baf83779d2990ac2264c Mon Sep 17 00:00:00 2001 From: Simon Asika Date: Wed, 19 Oct 2016 00:03:29 +0800 Subject: [PATCH] Fix Field::getValue() --- src/Form/Field/AbstractField.php | 10 ++++++++++ src/Form/Form.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Form/Field/AbstractField.php b/src/Form/Field/AbstractField.php index 6be034844..298852a43 100644 --- a/src/Form/Field/AbstractField.php +++ b/src/Form/Field/AbstractField.php @@ -547,6 +547,16 @@ public function getValue() return ($this->value !== null && $this->value !== '') ? $this->value : $this->getAttribute('default'); } + /** + * getRawValue + * + * @return mixed + */ + public function getRawValue() + { + return $this->value; + } + /** * Method to set property value * diff --git a/src/Form/Form.php b/src/Form/Form.php index 863e48daf..4213421db 100644 --- a/src/Form/Form.php +++ b/src/Form/Form.php @@ -807,7 +807,7 @@ public function getValues($fieldset = null, $group = null) foreach ($this->getFields($fieldset, $group) as $name => $field) { - FormHelper::setByPath($data, $name, $field->getValue()); + FormHelper::setByPath($data, $name, $field->getRawValue()); } return $data;