Skip to content

Commit

Permalink
Merge forwardport of #11349 to 2.3-develop branch
Browse files Browse the repository at this point in the history
Applied pull request patch https://github.com/magento/magento2/pull/11349.patch (created by @manuelson) based on commit(s):
  1. 3a42624
  2. 89a49fd

Fixed GitHub Issues in 2.3-develop branch:
  - #11329: Unable to proceed massaction "Update attributes" with required multiple select attribute (reported by @tcurilla)
  • Loading branch information
magento-engcom-team authored Jan 29, 2018
2 parents 6746da4 + b322c09 commit 413f939
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ public function getElementHtml()
$this->addClass('select multiselect admin__control-multiselect');
$html = '';
if ($this->getCanBeEmpty()) {
$html .= '<input type="hidden" name="' . parent::getName() . '" value="" />';
$html .= '
<input type="hidden" id="' . $this->getHtmlId() . '_hidden" name="' . parent::getName() . '" value="" />
';
}
$html .= '<select id="' . $this->getHtmlId() . '" name="' . $this->getName() . '" ' . $this->serialize(
$this->getHtmlAttributes()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ protected function setUp()
*/
public function testHiddenFieldPresentInMultiSelect()
{
$this->_model->setDisabled(true);
$fieldName = 'fieldName';
$fieldId = 'fieldId';
$this->_model->setCanBeEmpty(true);
$this->_model->setName($fieldName);
$this->_model->setId($fieldId);
$elementHtml = $this->_model->getElementHtml();
$this->assertContains('<input type="hidden"', $elementHtml);
$this->assertContains(
'<input type="hidden" id="' . $fieldId . '_hidden" name="' . $fieldName . '"',
$elementHtml
);
}

/**
Expand Down

0 comments on commit 413f939

Please sign in to comment.