From cb3cd636ae1c4c7ad26b124204dc0aea6a9384da Mon Sep 17 00:00:00 2001 From: Leonardo Ruhland Date: Thu, 7 Jan 2016 09:31:22 -0200 Subject: [PATCH 1/5] Remove default input type from SearchHelper --- src/View/Helper/SearchHelper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/View/Helper/SearchHelper.php b/src/View/Helper/SearchHelper.php index 5b8bbca..652e340 100644 --- a/src/View/Helper/SearchHelper.php +++ b/src/View/Helper/SearchHelper.php @@ -61,10 +61,10 @@ public function filterForm($filters = [], $options = []) foreach ($filters as $field) { // if field is select-box because of the options-key if ($field['options']) { - $html .= $this->Form->select($field['column'], $field['options'], $field['attributes']); - } else { - $html .= $this->Form->input($field['column'], $field['attributes']); + $field['attributes']['options'] = $field['options']; } + $html .= $this->Form->input($field['column'], $field['attributes']); + $html .= ' '; } // end From 854f7548f5fb6815df50e1797eec793e5a16a889 Mon Sep 17 00:00:00 2001 From: Leonardo Ruhland Date: Thu, 7 Jan 2016 09:32:02 -0200 Subject: [PATCH 2/5] Remove default input type from SearchComponent --- src/Controller/Component/SearchComponent.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Controller/Component/SearchComponent.php b/src/Controller/Component/SearchComponent.php index 66d4526..d6521f1 100644 --- a/src/Controller/Component/SearchComponent.php +++ b/src/Controller/Component/SearchComponent.php @@ -36,7 +36,6 @@ class SearchComponent extends Component 'operator' => 'LIKE', 'attributes' => [ 'label' => false, - 'type' => 'text', 'placeholder' => null, ], 'options' => false From 5bbacabd15e6d4573385039df1e0df85bfea8750 Mon Sep 17 00:00:00 2001 From: Leonardo Ruhland Date: Thu, 7 Jan 2016 09:33:04 -0200 Subject: [PATCH 3/5] Remove default input type from SearchComponentTest --- tests/TestCase/Controller/Component/SearchComponentTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/TestCase/Controller/Component/SearchComponentTest.php b/tests/TestCase/Controller/Component/SearchComponentTest.php index ff5f938..8a5e192 100644 --- a/tests/TestCase/Controller/Component/SearchComponentTest.php +++ b/tests/TestCase/Controller/Component/SearchComponentTest.php @@ -85,7 +85,6 @@ public function testAddFilter() 'operator' => 'LIKE', 'attributes' => [ 'label' => false, - 'type' => 'text', 'placeholder' => null ], 'options' => false From 2e94223ff878146d5388f744bbe50d6c1e1b4885 Mon Sep 17 00:00:00 2001 From: Leonardo Ruhland Date: Thu, 7 Jan 2016 09:33:36 -0200 Subject: [PATCH 4/5] Remove default input type from SearchHelperTest --- tests/TestCase/View/Helper/SearchHelperTest.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/TestCase/View/Helper/SearchHelperTest.php b/tests/TestCase/View/Helper/SearchHelperTest.php index 18da369..45585a0 100644 --- a/tests/TestCase/View/Helper/SearchHelperTest.php +++ b/tests/TestCase/View/Helper/SearchHelperTest.php @@ -44,7 +44,6 @@ public function setUp() 'operator' => 'LIKE', 'attributes' => [ 'label' => false, - 'type' => 'text', 'placeholder' => 'title' ], 'options' => false @@ -55,7 +54,6 @@ public function setUp() 'operator' => '=', 'attributes' => [ 'label' => false, - 'type' => 'text', 'placeholder' => 'category', 'empty' => true ], @@ -88,7 +86,7 @@ public function testFilterForm() $this->assertContains('
', $result); $this->assertContains('', $result); - $this->assertContains('', $result); $this->assertContains('', $result); $this->assertContains('', $result); From 750413982ea942be26036172094d3fc8a79a370a Mon Sep 17 00:00:00 2001 From: Leonardo Ruhland Date: Thu, 7 Jan 2016 09:43:48 -0200 Subject: [PATCH 5/5] Fix SearchHelper test --- tests/TestCase/View/Helper/SearchHelperTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/TestCase/View/Helper/SearchHelperTest.php b/tests/TestCase/View/Helper/SearchHelperTest.php index 45585a0..9881055 100644 --- a/tests/TestCase/View/Helper/SearchHelperTest.php +++ b/tests/TestCase/View/Helper/SearchHelperTest.php @@ -86,7 +86,7 @@ public function testFilterForm() $this->assertContains('', $result); $this->assertContains('', $result); - $this->assertContains('