Skip to content

Commit

Permalink
Fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtlambda committed May 13, 2016
1 parent 79439b6 commit bf3aca0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/fieldwork/components/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ abstract class Field extends Component
$label,
$visible = true,
$enabled = true,
$restored = false,
$value,
$initialValue,
$latestErrorMsg = "",
Expand Down Expand Up @@ -84,7 +85,8 @@ public function restoreValue (Method $method, $sanitize = true)
foreach ($this->sanitizers as $s)
/* @var $s FieldSanitizer */
$v = $s->sanitize($v);
$this->value = $v;
$this->value = $v;
$this->restored = true;
}

/**
Expand Down Expand Up @@ -211,8 +213,9 @@ public function getJsonData ()
foreach ($this->sanitizers as $sanitizer)
/* @var $sanitizer FieldSanitizer */
$s[] = $sanitizer->getJsonData();
$valid = $this->restored ? $this->isValid() : true;
return array(
'valid' => $this->isValid(),
'valid' => $valid,
'error' => $this->latestErrorMsg,
'validators' => $v,
'sanitizers' => $s,
Expand Down

0 comments on commit bf3aca0

Please sign in to comment.