Skip to content

Unable to unselect all multiselect values #7687

Closed
@Vinai

Description

@Vinai

Magento version: 2.1.2

It is not possible to unselect and save all multiselect attribute values for a product.
After the save completes the state of the product attribute before the product was saved is unchanged.
It seems the problem is that the JS does not submit multiselect form elements with no selected values, at least on the server side completely unselected multiselect attribtues are not part of the $_POST['product'] array.

The exact same issue existed for years on M1 but was finally fixed there. It seems like this issue was introduced again for M2.

Preconditions

None special.

Steps to reproduce

  1. Create a custom multiselect attribute. Ot just install the sample data (e.g. the issue can be reproduced using the features_bag or strap_bags attributes).
  2. Open the product in the admin interface.
  3. Select one or more values of the multiselect attribtue.
  4. Save
  5. Unselect all values of the multiselect attribute
  6. Save again

Expected result

The product attribute should have no value for the product.

Actual result

The previously selected product attributes still are selected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CatalogIssue: Cannot ReproduceCannot reproduce the issue on the latest `2.4-develop` branchIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions