Skip to content

Commit

Permalink
Fix #172: More correct InputWidget attribute name parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Oct 14, 2014
1 parent 9456c1c commit c5438db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
=============
Expand Down
4 changes: 2 additions & 2 deletions InputWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -303,4 +303,4 @@ protected function parseDateFormat($type)
throw InvalidConfigException("Error parsing '{$type}' format.");
}
}
}
}

0 comments on commit c5438db

Please sign in to comment.