Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 3a42624

Browse files
committed
Bug fix update attributes
1 parent d30f077 commit 3a42624

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/internal/Magento/Framework/Data/Form/Element/Multiselect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function getElementHtml()
5757
$this->addClass('select multiselect admin__control-multiselect');
5858
$html = '';
5959
if ($this->getCanBeEmpty()) {
60-
$html .= '<input type="hidden" name="' . parent::getName() . '" value="" />';
60+
$html .= '<input type="hidden" id="' . $this->getHtmlId() . '_hidden" name="' . parent::getName() . '" value="" />';
6161
}
6262
if (!empty($this->_data['disabled'])) {
6363
$html .= '<input type="hidden" name="' . parent::getName() . '_disabled" value="" />';

lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/MultiselectTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ protected function setUp()
2727
public function testHiddenFieldPresentInMultiSelect()
2828
{
2929
$fieldName = 'fieldName';
30+
$fieldId = 'fieldId';
3031
$this->_model->setCanBeEmpty(true);
3132
$this->_model->setName($fieldName);
33+
$this->_model->setId($fieldId);
3234
$elementHtml = $this->_model->getElementHtml();
33-
$this->assertContains('<input type="hidden" name="' . $fieldName . '"', $elementHtml);
35+
$this->assertContains(
36+
'<input type="hidden" id="' . $fieldId . '_hidden" name="' . $fieldName . '"', $elementHtml
37+
);
3438
}
3539

3640
/**

0 commit comments

Comments
 (0)