mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
"Adding patches and test from #4447.
Closes #4447, Multiselects' hidden input should not have an id attribute. Thanks sarimarton" git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6640 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
def8f8aad1
commit
1250c6e0cc
2 changed files with 5 additions and 2 deletions
|
@ -1059,7 +1059,7 @@ class FormHelper extends AppHelper {
|
|||
} else {
|
||||
$tag = $this->Html->tags['selectmultiplestart'];
|
||||
}
|
||||
$select[] = $this->hidden(null, array('value' => ''));
|
||||
$select[] = $this->hidden(null, array('value' => '', 'id' => null));
|
||||
} else {
|
||||
$tag = $this->Html->tags['selectstart'];
|
||||
}
|
||||
|
|
|
@ -618,7 +618,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
$this->assertPattern('/^<div[^<>]+class="input"[^<>]*><label[^<>]+for="UserUser"[^<>]*>User<\/label>/', $result);
|
||||
$this->assertPattern('/<select[^<>]+>\s+<option value=""\s*><\/option>\s+<option value="value"/', $result);
|
||||
$this->assertPattern('/<select[^<>]+multiple="multiple"[^<>\/]*>/', $result);
|
||||
$this->assertNoPattern('/<select[^<>]+[^(name|id|multipl)]=[^<>\/]*>/', $result);
|
||||
$this->assertNoPattern('/<select[^<>]+[^(name|id|multiple)]=[^<>\/]*>/', $result);
|
||||
}
|
||||
|
||||
function testFormInputs() {
|
||||
|
@ -914,6 +914,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
$this->assertPattern('/^<input type="hidden"[^<>]+ \/>\s*<select[^<>]+name="data\[Model\]\[multi_field\]\[\]"[^<>\/]*>/', $result);
|
||||
$this->assertPattern('/^<input type="hidden"[^<>]+ \/>\s*<select[^<>]+id="ModelMultiField"[^<>\/]*>/', $result);
|
||||
$this->assertPattern('/^<input type="hidden"[^<>]+ \/>\s*<select[^<>]+multiple="multiple"[^<>\/]*>/', $result);
|
||||
$this->assertNoPattern('/^<input type="hidden"[^<>]+id=[^<>]*>/', $result);
|
||||
$this->assertNoPattern('/^<select[^<>]+[^name|id|multiple]=[^<>\/]*>/', $result);
|
||||
$this->assertNoPattern('/option value=""/', $result);
|
||||
$this->assertNoPattern('/selected/', $result);
|
||||
|
@ -925,6 +926,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
|
||||
$result = $this->Form->select('Model.multi_field', array('first', 'second', 'third'), null, array('multiple' => 'multiple'));
|
||||
$this->assertPattern('/^<input type="hidden"[^<>]+ \/>\s*<select[^<>]+multiple="multiple"[^<>\/]*>/', $result);
|
||||
$this->assertNoPattern('/^<input type="hidden"[^<>]+id=[^<>]*>/', $result);
|
||||
$this->assertNoPattern('/^<select[^<>]+[^name|id|multiple]=[^<>\/]*>/', $result);
|
||||
|
||||
$result = $this->Form->select('Model.multi_field', array('first', 'second', 'third'), array(0, 1), array('multiple' => true));
|
||||
|
@ -1550,6 +1552,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
$this->assertPattern('/^<input type="hidden"[^<>]+ \/>\s*<select[^<>]+name="data\[People\]\[People\]\[\]"[^<>]*>/', $result);
|
||||
$this->assertPattern('/^<input type="hidden"[^<>]+ \/>\s*<select[^<>]+multiple="multiple"[^<>]*>/', $result);
|
||||
$this->assertPattern('/^<input type="hidden"[^<>]+ \/>\s*<select[^<>]+id="PeoplePeople"[^<>]*>/', $result);
|
||||
$this->assertNoPattern('/^<input type="hidden"[^<>]+id=[^<>]*>/', $result);
|
||||
$this->assertNoPattern('/<select[^<>]+[^id|name|multiple]=[^<>]*>$/', $result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue