-
Notifications
You must be signed in to change notification settings - Fork 9.4k
sku attribute save error #7247
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
Comments
I have seen this ticket - #3687 suggesting it's not possible to update the sku value through the api. If this is the case, can you change the error message to something more meaningful to indicate that the sku can't be changed as it's a unique key. |
I'm also getting the same issue on trying to update the category the product belongs to. This happens in program module-eav\Model\Entity\AbstractEntity.php - saveAttribute method. |
Hi, thank you for your report. The purpose of addAttributeUpdate($code, $value, $store) in Catalog/Model/Product.php is to update EAV attributes only. So you cannot use this method for SKU which is not en EAV attribute. Closed as not a bug |
I agree it is not a bug but the error could indicate the problem generically such as just what you said, error: Cannot update non-eav attribute. |
[Platform Health] Updates for PHP8.1
Preconditions
Note: I thought this may be the same as bug sku attribute save error #1222 but I have upgraded from Magento 2.1.0 to 2.1.2 and am still seeing the same error
Steps to reproduce
I am updating the attributes of an existing product through the Magento API, using method addAttributeUpdate($code, $value, $store) in Catalog/Model/Product.php
I am able to update other product attributes (of any scope) using this method apart from the sku attribute, I get error Unknown column 'catalog_product_entity.value_id' in 'field list' in C:\xampp\htdocs\magento\vendor\magento\zendframework1\library\Zend\Db\Statement\Pdo.php on line 228
So I want to change the sku name from one value to another value through the method, but get the above error message.
Expected result
Actual result
Next exception 'Exception' with message 'Report ID: webapi-58172eac5556e; Message: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'catalog_product_entity.value_id' in 'field list', query was: SELECT
catalog_product_entity
.value_id
FROMcatalog_product_entity
WHERE (attribute_id='71' AND entity_id='2052')' in C:\xampp\htdocs\magento\vendor\magento\framework\Webapi\ErrorProcessor.php:195Stack trace:
#0 C:\xampp\htdocs\magento\vendor\magento\framework\Webapi\ErrorProcessor.php(139): Magento\Framework\Webapi\ErrorProcessor->_critical(Object(Zend_Db_Statement_Exception))
Can you commit to repository a folder dev/tests/static ? #1 C:\xampp\htdocs\magento\vendor\magento\module-webapi\Controller\Rest.php(219): Magento\Framework\Webapi\ErrorProcessor->maskException(Object(Zend_Db_Statement_Exception))
BUG FIX - Uncaught exception when accessing admin with none existent use... #2 C:\xampp\htdocs\magento\var\generation\Magento\Webapi\Controller\Rest\Interceptor.php(37): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))
__DIR__ Typo fixed #3 C:\xampp\htdocs\magento\vendor\magento\framework\App\Http.php(135): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
Enable Magento_Profiler by SetEnv #4 C:\xampp\htdocs\magento\vendor\magento\framework\App\Bootstrap.php(258): Magento\Framework\App\Http->launch()
Enable automated CRUD setup for Adminhtml Grids #5 C:\xampp\htdocs\magento\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
Why use private for message ? #6 {main} [] []
The text was updated successfully, but these errors were encountered: