diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 0bc6723bd..6fcf2da66 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -1347,7 +1347,7 @@ class FormHelper extends AppHelper { $elements = array('Day','Month','Year','Hour','Minute','Meridian'); $attributes = array_merge(array('minYear' => null, 'maxYear' => null, 'separator' => '-'), (array)$attributes); if (isset($attributes['minuteInterval'])) { - $selectMinuteAttr['interval'] = $attributes['minuteInterval']; + $attributes['interval'] = $attributes['minuteInterval']; } else { $selectMinuteAttr['interval'] = 1; } diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index b4e82c826..170679408 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -1170,6 +1170,12 @@ class FormHelperTest extends CakeTestCase { $this->assertNoPattern('/option value="59"/', $result); $this->assertNoPattern('/]+selected="selected"[^>]*>/', $result); + $result = $this->Form->dateTime('Contact.date', 'DMY', '12', '', array('minuteInterval' => 5)); + $this->assertPattern('/]*>/', $result); + $this->assertPattern('/option value="55"/', $result); + $this->assertNoPattern('/option value="59"/', $result); + $this->assertNoPattern('/]+selected="selected"[^>]*>/', $result); + $this->Form->data['Contact']['data'] = null; $result = $this->Form->dateTime('Contact.date', 'DMY', '12'); $this->assertPattern('/]*>/', $result);