Skip to content

Unable to proceed massaction "Update attributes" with required multiple select attribute  #11329

Closed
@tcurilla

Description

@tcurilla

Preconditions

  1. Magento ver. 2.2.0
  2. PHP 7.0.24

Steps to reproduce

  1. clean install
  2. create product attribute Multiple Select with id "test_multiselect" and set required values to true
  3. fill some options values
  4. create product with previously created multiple select attribute
  5. save product
  6. In Adminhtml -> Catalog -> Products grid select product and do massaction "Update attributes"
  7. click on SAVE

Expected result

  1. Saving must be processed without error

Actual result

  1. Error "The value of attribute "test_multiselect" must be set" is shown
    image

Possible solution

In class method \Magento\Framework\Data\Form\Element\Multiselect::getElementHtml()
add "id" attribute to hidden element

if ($this->getCanBeEmpty()) {
    $html .= '<input type="hidden" name="' . parent::getName() . '" value="" />';
}

change to

if ($this->getCanBeEmpty()) {
    $html .= '<input type="hidden" id="' . $this->getHtmlId() . '_hidden" name="' . parent::getName() . '" value="" />';
}

see Magento_Catalog view/adminhtml/web/catalog/product.js disableFieldEditMode/enableFieldEditMode methods

Metadata

Metadata

Assignees

Labels

Fixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions