Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-select for Product edit not saving values other than first selection on Save #4822

Closed
synzhu opened this issue Jun 1, 2016 · 34 comments
Labels
bug report Component: Catalog Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Progress: needs update

Comments

@synzhu
Copy link

synzhu commented Jun 1, 2016

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.
screen shot 2016-06-01 at 4 02 32 pm
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

screen shot 2016-06-01 at 4 09 52 pm

screen shot 2016-06-01 at 4 11 17 pm

but if I press Save, again it only selects the first one and all the others are removed from database as well.

screen shot 2016-06-01 at 4 12 49 pm

screen shot 2016-06-01 at 4 13 27 pm

@pboisvert pboisvert changed the title I am Multi-select for Product edit not saving values other than first selection on Save Jun 2, 2016
@sunilit42
Copy link
Contributor

have you created attribute using script or backed?

@synzhu
Copy link
Author

synzhu commented Jun 3, 2016

It was migrated from Magento 1. I have not checked if this problem exists with new attributes created in Magento 2.

@sunilit42
Copy link
Contributor

may be it problem with migration Plase check source model and backend model for same.

@salelsol
Copy link

salelsol commented Jun 9, 2016

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.

@mitcht
Copy link

mitcht commented Jun 15, 2016

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_ table. I've tried text and varchar. Both save but will not populate the dropdown.

@palamar
Copy link
Contributor

palamar commented Jun 22, 2016

@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.

@salelsol
Copy link

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.

@jvreeken
Copy link

jvreeken commented Oct 14, 2016

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:
UPDATEeav_attributeSETbackend_model= 'Magento\\Eav\\Model\\Entity\\Attribute\\Backend\\ArrayBackend' WHEREattribute_code= ‘your_attribute_code';

Replace "your_attribute_code" with the attribute code of the attribute that is giving you trouble.

@smokygeek17
Copy link

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

@AbdulKadir-Agoliya
Copy link

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.

@smokygeek17
Copy link

@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

@Szymon-GP
Copy link

2.1.4 and the problem still exist

@daniel-ifrim
Copy link

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:
#7646
#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 ?

@AlexWorking
Copy link

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.

@magento-engcom-team magento-engcom-team added the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label Sep 18, 2017
@AgentGod
Copy link

Hello Magento Team,
I had similar problem, but only sometime. After some investigation I found:

  1. Can not save multiselect attributes if there is related product attached.
  2. If I have any product attached to related, when I try to change options in multiselect attributes, I was not able to save with the new selection set.
  3. On the same products when I remove the product attached to related, everything worked as expected.
    So if I have any product with multiselect which needs change, I had to remove related products, make changes to multiselect options and save. After saving all atributes are saved correctly and then add the related products and save again.
    Tested on Magento 2.2

@duckchip
Copy link
Contributor

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:

  1. remove all upsells, cross-sells and related products.
  2. save the product
  3. make changes to the multiselect attribute on the product
  4. save the product
  5. add all the upsells, ...

@AbdulKadir-Agoliya
Copy link

@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 .

@AbdulKadir-Agoliya
Copy link

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 .

@duckchip
Copy link
Contributor

duckchip commented Oct 31, 2017

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/....

@vseager
Copy link
Contributor

vseager commented Jan 9, 2018

Still having the problem on 2.1.11

@vseager
Copy link
Contributor

vseager commented Jan 9, 2018

Update: This was fixed by...

#4822 (comment)

@imanasmage
Copy link

I have this exact issue on Magento 2.2.5

@A-1A
Copy link

A-1A commented Jun 19, 2018

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

@mariamghalleb
Copy link

same issue, magento 2.2.4

@AbdulKadir-Agoliya
Copy link

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 .

@collinanderson
Copy link

I had to change backend_type from varchar to text to get it to work.

@mariamghalleb
Copy link

@AbdulKadir-Agoliya that column is not NULL by default it has Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend.

@SKovbel
Copy link

SKovbel commented Jul 20, 2018

getData($key) and getData()[$key] return different values, scalar vs array

My fix
screenshot from 2018-07-20 17-33-40

@PetmePant
Copy link

@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

@insaneCreations
Copy link

insaneCreations commented Jan 22, 2019

I still have the problem in 2.1.9 and this is beginneng to get frustrated.

I had to change backend_type from varchar to text 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

@insaneCreations
Copy link

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

@saminforca
Copy link

saminforca commented May 10, 2019

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

@saminforca
Copy link

saminforca commented May 10, 2019

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.

@darrenf-fisheye
Copy link

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.

You also need to reindex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Catalog Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Progress: needs update
Projects
None yet
Development

No branches or pull requests