Skip to content

Can't save attributes on a configurable product #13177

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

Closed
bambamboole opened this issue Jan 15, 2018 · 10 comments
Closed

Can't save attributes on a configurable product #13177

bambamboole opened this issue Jan 15, 2018 · 10 comments
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update

Comments

@bambamboole
Copy link

bambamboole commented Jan 15, 2018

Preconditions

I have a Magento Installation where I can't save attributes on a configurable product. (simple products work!).

Magento Version: 2.2.2
PHP Version: 7.1.13
MySQL Version: 10.1.30-MariaDB

Steps to reproduce

  1. Add a configurable product
  2. Change some attributes (tested with product images and country of manufacturer)
  3. Press Save

Actual Result

The following error occurs:

Warning: array_filter() expects parameter 1 to be array, string given in /var/www/dev.****.com/htdocs/web/vendor/magento/module-configurable-product/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Configurable.php on line 145

Expected Result

The product should be saved normally

@magento-engcom-team magento-engcom-team added Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Jan 15, 2018
@magento-engcom-team
Copy link
Contributor

@bambamboole , thank you for your report.
We were not able to reproduce this issue by following the steps you provided. Please provide more detailed steps to reproduce or try to reproduce this issue on a clean installation or latest release.

@magento-engcom-team
Copy link
Contributor

@bambamboole, we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.

@davygxyz
Copy link

davygxyz commented Feb 9, 2018

@bambamboole Did you ever get this figure out? Getting same error. Magento 2.2.1

@bambamboole
Copy link
Author

@davygxyz Yeah it was a problem with the Web Application Firewall in Azure. After some research I saw an Ajax Request which responded with a 403 nginx page. After that it was clear it is no problem with magento but with the setup.

@davygxyz
Copy link

davygxyz commented Feb 9, 2018

@bambamboole Nice! thanks for leading me in the right direction. I've been stuck on it for a day, so this helps.

@ctadlock
Copy link

This issue happens when one of the attributes of the products is required.

@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 also please check
https://magento.stackexchange.com/questions/224621/warning-array-filter-expects-parameter-1-to-be-array/230444#230444

swnsma pushed a commit to swnsma/magento2-1 that referenced this issue Jul 6, 2018
- fix error while saving configurable product after validation error.
@magento-engcom-team
Copy link
Contributor

Hi @bambamboole. Thank you for your report.
The issue has been fixed in #16597 by @swnsma in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.7 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Aug 8, 2018
@allanpaiste
Copy link

allanpaiste commented Sep 4, 2018

Why not 2.2.6? This is pretty serious problem and might cause quite a many frustrated users from having to re-type their changes after first validation error on a configurable product form wiping rendering the whole form unsaveable.

@steps
1. use 2.2.0 - 2.2.5 with sample data
2. [admin] navigate to Catalog > Products
3. [admin] filter the list by Configurable products
4. [admin] open any product (let's say: first one)
5. [admin] create a validation error (blank out the name of a product for example)
6. [admin] attempt to save it (use main orange Save button)
7. [admin] {nothing happens because there's a validation error}
8. [admin] fix the validation error (restore the name)
9. [admin] attempt to save again (use main orange Save button)

@expected 
1. product gets properly saved

@actual
1. Magento crashes (basically you lose your data and have to reload the page and 
   retype everything, while making it dead-sure that you have no form validation errors)

I'd strongly urge this change to be part of 2.2.6!

@hryksbt
Copy link

hryksbt commented Dec 12, 2018

I faced similar error when I try to add a new configurable product.
My magento is CE 2.2.6.

If I put price for accociated child priducts such as 10000.00, this error will be occurred.
So I tried to put price such as 10000, I could skip this error.

My currency setting is JPY. JPY doesn't have decimal point price.

I think Magento 2 has price operation issue, especially "," mark or "." mark. Also, that should support decimal point and no decimal point price.

Warning: array_filter() expects parameter 1 to be array, string given in /var/www/*****.com/vendor/magento/module-configurable-product/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Configurable.php on line 145ß

{"0":"Notice: Undefined variable: product in \/var\/www\/*****.com\/vendor\/magento\/module-catalog\/Controller\/Adminhtml\/Product\/Save.php on line 156","1":"#0 \/var\/www\/*****.com\/vendor\/magento\/module-catalog\/Controller\/Adminhtml\/Product\/Save.php(156): Magento\\Framework\\App\\ErrorHandler->handler(8, 'Undefined varia...', '\/var\/www\/illust...', 156, Array)\n#1 \/var\/www\/*****.com\/vendor\/magento\/framework\/App\/Action\/Action.php(107): Magento\\Catalog\\Controller\\Adminhtml\\Product\\Save->execute()\n#2 \/var\/www\/*****.com\/vendor\/magento\/module-backend\/App\/AbstractAction.php(235): Magento\\Framework\\App\\Action\\Action->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#3 \/var\/www\/*****.com\/vendor\/magento\/framework\/Interception\/Interceptor.php(58): Magento\\Backend\\App\\AbstractAction->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#4 \/var\/www\/*****.com\/vendor\/magento\/framework\/Interception\/Interceptor.php(138): Magento\\Catalog\\Controller\\Adminhtml\\Product\\Save\\Interceptor->___callParent('dispatch', Array)\n#5 \/var\/www\/*****.com\/vendor\/magento\/module-backend\/App\/Action\/Plugin\/Authentication.php(143): Magento\\Catalog\\Controller\\Adminhtml\\Product\\Save\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#6 \/var\/www\/*****.com\/vendor\/magento\/framework\/Interception\/Interceptor.php(135): Magento\\Backend\\App\\Action\\Plugin\\Authentication->aroundDispatch(Object(Magento\\Catalog\\Controller\\Adminhtml\\Product\\Save\\Interceptor), Object(Closure), Object(Magento\\Framework\\App\\Request\\Http))\n#7 \/var\/www\/*****.com\/vendor\/magento\/framework\/Interception\/Interceptor.php(153): Magento\\Catalog\\Controller\\Adminhtml\\Product\\Save\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#8 \/var\/www\/*****.com\/generated\/code\/Magento\/Catalog\/Controller\/Adminhtml\/Product\/Save\/Interceptor.php(26): Magento\\Catalog\\Controller\\Adminhtml\\Product\\Save\\Interceptor->___callPlugins('dispatch', Array, NULL)\n#9 \/var\/www\/*****.com\/vendor\/magento\/framework\/App\/FrontController.php(55): Magento\\Catalog\\Controller\\Adminhtml\\Product\\Save\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#10 \/var\/www\/*****.com\/vendor\/magento\/framework\/Interception\/Interceptor.php(58): Magento\\Framework\\App\\FrontController->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#11 \/var\/www\/*****.com\/vendor\/magento\/framework\/Interception\/Interceptor.php(138): Magento\\Framework\\App\\FrontController\\Interceptor->___callParent('dispatch', Array)\n#12 \/var\/www\/*****.com\/vendor\/m2e\/ebay-amazon-magento2\/Plugin\/HealthStatus\/Magento\/Framework\/App\/FrontController.php(79): Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#13 \/var\/www\/*****.com\/vendor\/m2e\/ebay-amazon-magento2\/Plugin\/AbstractPlugin.php(43): Ess\\M2ePro\\Plugin\\HealthStatus\\Magento\\Framework\\App\\FrontController->processDispatch(Object(Magento\\Framework\\App\\FrontController\\Interceptor), Object(Closure), Array)\n#14 \/var\/www\/*****.com\/vendor\/m2e\/ebay-amazon-magento2\/Plugin\/HealthStatus\/Magento\/Framework\/App\/FrontController.php(42): Ess\\M2ePro\\Plugin\\AbstractPlugin->execute('dispatch', Object(Magento\\Framework\\App\\FrontController\\Interceptor), Object(Closure), Array)\n#15 \/var\/www\/*****.com\/vendor\/magento\/framework\/Interception\/Interceptor.php(135): Ess\\M2ePro\\Plugin\\HealthStatus\\Magento\\Framework\\App\\FrontController->aroundDispatch(Object(Magento\\Framework\\App\\FrontController\\Interceptor), Object(Closure), Object(Magento\\Framework\\App\\Request\\Http))\n#16 \/var\/www\/*****.com\/vendor\/magento\/framework\/Interception\/Interceptor.php(153): Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#17 \/var\/www\/*****.com\/generated\/code\/Magento\/Framework\/App\/FrontController\/Interceptor.php(26): Magento\\Framework\\App\\FrontController\\Interceptor->___callPlugins('dispatch', Array, NULL)\n#18 \/var\/www\/*****.com\/vendor\/magento\/framework\/App\/Http.php(135): Magento\\Framework\\App\\FrontController\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#19 \/var\/www\/*****.com\/vendor\/magento\/framework\/App\/Bootstrap.php(257): Magento\\Framework\\App\\Http->launch()\n#20 \/var\/www\/*****.com\/pub\/index.php(37): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http\\Interceptor))\n#21 {main}","url":"\/admin_evipom\/catalog\/product\/save\/type\/configurable\/store\/0\/set\/4\/key\/f538bccfcf95ae729e26d83c6edc469603335a2637a2da16a0fe13af2174d035\/back\/edit","script_name":"\/index.php"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update
Projects
None yet
Development

No branches or pull requests

7 participants