File tree 2 files changed +11
-3
lines changed
lib/internal/Magento/Framework/Data 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,9 @@ public function getElementHtml()
57
57
$ this ->addClass ('select multiselect admin__control-multiselect ' );
58
58
$ html = '' ;
59
59
if ($ this ->getCanBeEmpty ()) {
60
- $ html .= '<input type="hidden" name=" ' . parent ::getName () . '" value="" /> ' ;
60
+ $ html .= '
61
+ <input type="hidden" id=" ' . $ this ->getHtmlId () . '_hidden" name=" ' . parent ::getName () . '" value="" />
62
+ ' ;
61
63
}
62
64
$ html .= '<select id=" ' . $ this ->getHtmlId () . '" name=" ' . $ this ->getName () . '" ' . $ this ->serialize (
63
65
$ this ->getHtmlAttributes ()
Original file line number Diff line number Diff line change @@ -26,10 +26,16 @@ protected function setUp()
26
26
*/
27
27
public function testHiddenFieldPresentInMultiSelect ()
28
28
{
29
- $ this ->_model ->setDisabled (true );
29
+ $ fieldName = 'fieldName ' ;
30
+ $ fieldId = 'fieldId ' ;
30
31
$ this ->_model ->setCanBeEmpty (true );
32
+ $ this ->_model ->setName ($ fieldName );
33
+ $ this ->_model ->setId ($ fieldId );
31
34
$ elementHtml = $ this ->_model ->getElementHtml ();
32
- $ this ->assertContains ('<input type="hidden" ' , $ elementHtml );
35
+ $ this ->assertContains (
36
+ '<input type="hidden" id=" ' . $ fieldId . '_hidden" name=" ' . $ fieldName . '" ' ,
37
+ $ elementHtml
38
+ );
33
39
}
34
40
35
41
/**
You can’t perform that action at this time.
0 commit comments