From c5438db49f02f29328f5e8fafcab857f19acf2fe Mon Sep 17 00:00:00 2001 From: Kartik Visweswaran Date: Tue, 14 Oct 2014 13:30:14 +0530 Subject: [PATCH] Fix #172: More correct InputWidget attribute name parsing --- CHANGE.md | 1 + InputWidget.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGE.md b/CHANGE.md index 2471f68..aa3d2a3 100644 --- a/CHANGE.md +++ b/CHANGE.md @@ -3,6 +3,7 @@ version 3.1.0 **Date:** 10-Oct-2014 1. enh #169: Enhancement for ICU format conversion for DatePicker and DateTimePicker (enrica, kartik-v). +2. bug #172: More correct InputWidget name field parsing. version 3.0.0 ============= diff --git a/InputWidget.php b/InputWidget.php index 8360ef4..df3ef1e 100644 --- a/InputWidget.php +++ b/InputWidget.php @@ -93,7 +93,7 @@ public function init() $this->_loadIndicator = self::LOAD_PROGRESS; } if ($this->hasModel()) { - $this->name = ArrayHelper::remove($this->options, 'name', Html::getInputName($this->model, $this->attribute)); + $this->name = empty($this->options['name']) ? Html::getInputName($this->model, $this->attribute) : $this->options['name']; $this->value = $this->model[Html::getAttributeName($this->attribute)]; } $view = $this->getView(); @@ -303,4 +303,4 @@ protected function parseDateFormat($type) throw InvalidConfigException("Error parsing '{$type}' format."); } } -} +} \ No newline at end of file