From 560af380fcff34cc08baab08be26268ced4a324f Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Wed, 20 Mar 2013 23:55:47 +0100 Subject: [PATCH] Don't fetch old input for unnamed fields. This is the proper fix for the underlying problem of #638. --- FormBuilder.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/FormBuilder.php b/FormBuilder.php index 374d453..d317e44 100644 --- a/FormBuilder.php +++ b/FormBuilder.php @@ -658,7 +658,7 @@ class FormBuilder { /** * Get the value that should be assigned to the field. * - * This returns either old input for this field, the + * If a name is given, this returns either old input for this field, the * value passed to this method or the equally-named attribute of the * current model instance (in this order of precedence). * @@ -668,6 +668,8 @@ class FormBuilder { */ protected function getValueAttribute($name, $value) { + if (is_null($name)) return $value; + if (isset($this->session) and $this->session->hasOldInput($name)) { return $this->session->getOldInput($name);