I am experiencing an issue similar to issue #4346. If I try to select multiple items for a multi select attribute from the product edit view (in this case, the attribute is Bolt Pattern), only the first one is actually saved to database when I press Save.
However, if I go to the database and manually add the value for the attribute in the catalog_product_entity_varchar
table, it shows up correctly when I reload the page in admin panel
but if I press Save, again it only selects the first one and all the others are removed from database as well.
have you created attribute using script or backed?
It was migrated from Magento 1. I have not checked if this problem exists with new attributes created in Magento 2.
may be it problem with migration Plase check source model and backend model for same.
Fixed, go to eav_attribute table, search you multiselect attribute and change in "backend_model" column NULL value with this value: Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend, clear cache and reindex and ty.
I'm seeing this problem too, albeit with Customer.. Created using a script properly. Can include source if requested. I'm using the Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend method. No values are persisting for me, but the attribute is saving the option_id to the database in the customer_entity_
@simon-zhu
Please, provide the used version. If the problem is actual for a specific tag, please, specify it and be sure that the latest update was used.
Hi Simon, used version is: Magento 2.0.7, PHP 5.6 and now multiselect works fine. This issue is coming afther migrate customers, order, etc from Magento 1.9 to Magento 2.
I was having the same problem. Migrated a site from 1.9.x to 2 and multiselect attributes have null for backend_model. saving the attributes would not change the values.
SQL to change would be:
UPDATE
eav_attributeSET
backend_model= 'Magento\\Eav\\Model\\Entity\\Attribute\\Backend\\ArrayBackend' WHERE
attribute_code= 鈥榶our_attribute_code';
Replace "your_attribute_code" with the attribute code of the attribute that is giving you trouble.
Magento 2.1.3 still reproducible. Multi-select attribute not being saved. Although
backend_type = varchar
backend_model = Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend
Fixed For me magento2.1.0, go to eav_attibute table, search you multiselect attibute and change in "backend_model" column NULL value with this value: Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend, clear cache and reindex and ty.
@AbdulKadir-Agoliya I tried that, but didn't help. The only workaround I found is to use the Mass action attributes update. Then it saves the change of multi-select attribute
2.1.4 and the problem still exist
I have this issue on not saving multiselect in a product.
I see this issue reported here. It could be various reasons but also it can be the same issue:
https://github.com/magento/magento2/issues/7646
https://github.com/magento/magento2/issues/5445
This happens to me if I have 1 configurable product from other attribute set that does not have this attribute in it.
Actually I'm doing more tests and I see that only if I have 1 configurable product (and doesn't matter if i have the multiselect in the second attribute set or not) in related products it will not save the attribute.
It happens only for multiselect. I've tested with dropdown and boolean and the issue is not there. I've tested it on CE 2.1.6 with sample data too.
Are you in the same case ? Do you have a configurable product in related, cross or up-sell products like my case ?
Hello, @simon-zhu. We were not able to reproduce Your on neither of develop versions for Magento2. (2.0.15, 2.1.7, 2.2.0). Please if You still can reproduce this issue on either of versions let us know. Thanks for Your reporting.
Hello Magento Team,
I had similar problem, but only sometime. After some investigation I found:
Tested on 2.1.9
I'm having the same issue. Even when creating a new product attribute of type multiselect in the backend, the problem occurs: when selecting an option in the multiselect on a product, the value doesn't get saved.
As @AgentGod explained, there's a detour of making this to work:
@duckchip
Fixed For me magento2.1.0, go to eav_attibute table, search you multiselect attibute and change in "backend_model" column NULL value with this value: Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend, clear cache and reindex .
hello @duckchip
Fixed For me magento2.1.0, go to eav_attibute table, search you multiselect attibute and change in "backend_model" column NULL value with this value: Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend, clear cache and reindex .
Hi @AbdulKadir-Agoliya
I'm running on 2.1.9 and this fix is already included, unfortunately it's still not working.
I think it has to do with a problem relating to configurable products as cross-sells/up-sells/....
Still having the problem on 2.1.11
Update: This was fixed by...
https://github.com/magento/magento2/issues/4822#issuecomment-253877404
I have this exact issue on Magento 2.2.5
I Found Solution after R&D On Magento database.
Login In your phpmyadmin
Go to your website database
Open "eav_attribute" table
Find Your multiselect "attribute_id"
Edit Row
If "backend_model" Column blank then paste this
Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend
And Please check this Url
https://magento.stackexchange.com/questions/224621/warning-array-filter-expects-parameter-1-to-be-array/230444#230444
same issue, magento 2.2.4
hello #mariamghalleb
Fixed For me magento2.1.0, go to eav_attibute table, search you multiselect attibute and change in "backend_model" column NULL value with this value: Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend, clear cache and reindex .
I had to change backend_type
from varchar
to text
to get it to work.
@AbdulKadir-Agoliya that column is not NULL by default it has Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend.
getData($key) and getData()[$key] return different values, scalar vs array
My fix
@AbdulKadir-Agoliya that column is not NULL by default it has Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend.
Same here. I still have to delete my related products in order to make it work
I still have the problem in 2.1.9 and this is beginneng to get frustrated.
I had to change
backend_type
fromvarchar
totext
to get it to work.
This works only then the dropdown in the frond-end goes away.
The solutions of changing the "backend_model" does not work for me, but is there someone who can help me with a solution
Magento 2.1.3 still reproducible. Multi-select attribute not being saved. Although
backend_type = varchar
backend_model = Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend
Dit you find a solution? Because i'm in 2.1.15 and i've tried all these methods and nothing works
same issue.
Magento 2.2.6 Multi-select attribute not being saved. Although
backend_type = varchar
backend_model = Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend
I also don't have any related products but still facing an issue
After long hind and seek with database, I came to know that it was the migration issue from m1 to Magento 2.
The following list of items has fixed the issue for me.
backend_type = text
backend_model = Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend
php bin/magento c:c
php bin/magento c:f
Hope this will fix it out for you.
After long hind and seek with database, I came to know that it was the migration issue from m1 to Magento 2.
The following list of items has fixed the issue for me.
backend_type = text
backend_model = Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackendphp bin/magento c:c
php bin/magento c:f
Hope this will fix it out for you.
You also need to reindex
Most helpful comment
Fixed, go to eav_attribute table, search you multiselect attribute and change in "backend_model" column NULL value with this value: Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend, clear cache and reindex and ty.