0

In Magento2, it was not possible to unselect and save all multiselect attribute values for a product in earlier versions. https://github.com/magento/magento2/issues/7687 mentioned this issue. I was not able to unselect all option of custom multi select attribute. I searched and found that need to use <can_be_select>1</<can_be_select> inside field (for example, multiselect) in system.xml. But still in latest version, this issue is occurred for a few cases.

1
  • It works on vendor\magento\module-payment\etc\adminhtml\system.xml. It also works on custom module too. If showInStore is used for multiselect and its 's showInStore is not specified, can_be_empty doesn't work at my end. If showInStore is removed from multiselect field in this case, can_be_empty works.
    – Wasim
    Commented May 11, 2022 at 9:10

1 Answer 1

3

If you mean a custom attribute - it seems a magento bug: magento bugtracker
If the question about the system config field - you should add can_be_empty to field definition in the etc/adminhtml/system.xml <field> .... <can_be_empty>1</can_be_empty> ... </field>

3
  • but i want to know in which core modules's sitemap.xml i have to do change Commented Jan 19, 2017 at 12:58
  • sitemap.xml? Are you mean the system.xml? If your question about your own custom field - you must know the path to own extension, if not - write the field title.
    – sergei.sss
    Commented Jan 19, 2017 at 13:04
  • no i did not make any extension. but i think i have to do this changing in any core files's sitemap.xml Commented Jan 19, 2017 at 13:10

Not the answer you're looking for? Browse other questions tagged or ask your own question.