I have created a custom multiselct product attribute pro grammatically. Everything is working fine i.e values are saving in databases and values also showing in product grid.But the selected values is not showing selected while editing the product.enter image description here

However If I create multiselct attribute from admin it showing selected .

enter image description here

  • Please try after indexing and save it again. – Aasim Goriya Dec 18 '18 at 6:56
  • I did re-indexing many times, but still the issue exist. – Ranjeet Singh Dec 18 '18 at 7:36

I had the same problem and I have solved it by following steps:

Step 1: Goto 'eav_attribute' table directly into the database and find the attribute code.

Step 2: Then check the 'backend_type'. It should be 'varchar' if not then change it to varchar manually.

Step 3: Now check 'backend_model'. It should be 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend'.

After the above changes flush the cache and test again.

  • I have already did this after lot of investigation. But it din't work. Attached the image of DB above. – Ranjeet Singh Dec 18 '18 at 8:20
  • Can you replace varchar by text and test again? Also did you flush the cache and reindex? – Sukumar Gorai Dec 18 '18 at 8:36
  • No , replacing varchar by text also not work – Ranjeet Singh Dec 18 '18 at 9:47

Your issue was mentioned here https://github.com/magento/magento2/issues/5885

Here is the patch for 2.1.x https://gist.github.com/tuyennn/77c3308b54b9abb7a907429c50166b6d

Or you could follow the merge commit and internal MAGETWO-57153 to trace and fix the issue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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