diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 422aa5841..bde591da8 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -2455,11 +2455,18 @@ class e_form } } + if(!isset($options['class'])) + { + $options['class'] = ''; + } + + $options['class'] .= ' form-check-input'; + $pre = (vartrue($options['label'])) ? "" : ""; unset($options['label']); // not to be used as attribute; - $text .= "get_attributes($options, $name, $value)." />"; + $text .= "get_attributes($options, $name, $value)." />"; return $pre.$text.$post; } diff --git a/e107_tests/tests/unit/e_formTest.php b/e107_tests/tests/unit/e_formTest.php index 09d774e20..81a34d4ad 100644 --- a/e107_tests/tests/unit/e_formTest.php +++ b/e107_tests/tests/unit/e_formTest.php @@ -395,7 +395,7 @@ class e_formTest extends \Codeception\Test\Unit { $result = $this->_frm->checkbox('name', 2, 2); - $expected = ""; + $expected = ""; $this->assertEquals($expected,$result); } @@ -410,15 +410,15 @@ class e_formTest extends \Codeception\Test\Unit $result = $this->_frm->checkboxes('name', $opts, array(2=>'two')); - $expected = "
"; + $expected = "
"; $this->assertEquals($expected,$result); $result = $this->_frm->checkboxes('name', $opts, 2, array('useKeyValues'=> 1)); - $expected = "
"; + $expected = "
"; $this->assertEquals($expected,$result); $result = $this->_frm->checkboxes('name', $opts, 'two', array('useLabelValues'=> 1)); - $expected= "
"; + $expected= "
"; $this->assertEquals($expected,$result); } @@ -936,7 +936,7 @@ class e_formTest extends \Codeception\Test\Unit 'image_001' => "\"e107_adminlogo.png\"", 'image_002' => "\"butterfly.jpg\"", - 'checkboxes_001' => "
", + 'checkboxes_001' => "
", 'country_001' => "", 'ip_001' => "", 'templates_001' => "",