Fix year form field when magic input wrapper is used.

s
This commit is contained in:
Mark Scherer 2015-04-20 18:31:00 +02:00
parent f925511a54
commit a9ae7fd5bb

View file

@ -2213,6 +2213,11 @@ class FormHelper extends AppHelper {
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::year
*/
public function year($fieldName, $minYear = null, $maxYear = null, $attributes = array()) {
if (is_array($minYear)) {
$attributes = $minYear;
$minYear = null;
}
$attributes += array('empty' => true, 'value' => null);
if ((empty($attributes['value']) || $attributes['value'] === true) && $value = $this->value($fieldName)) {
if (is_array($value)) {