From a138ae3d63c8bf9e71d62bf6011c5480c6964c58 Mon Sep 17 00:00:00 2001 From: phpnut Date: Fri, 4 Apr 2008 12:48:13 +0000 Subject: [PATCH] "Fixing use of array('minuteInterval' => #); Proper usage is array('interval' => #); but for backwards compatibility this fix has been added" git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6633 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/helpers/form.php | 2 +- cake/tests/cases/libs/view/helpers/form.test.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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);