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
Empty varchar attribute store level value wrong save in flat catalog #38548
Comments
Hi @hiren-gujarati. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hi @engcom-Bravo. Thank you for working on this issue.
|
Hi @hiren-gujarati, Thanks for your reporting and Collaboration. As per Magento devdocs https://experienceleague.adobe.com/en/docs/commerce-admin/catalog/catalog/catalog-flat Use of a flat catalog is no longer recommended as a best practice. Could you please check document and let us know if you are still facing any issue. Thanks. |
Hi @hiren-gujarati, Thank you for reporting and collaboration. Verified the issue on Magento 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots. catalog_product_flat_{store_id} getting store scope value when Indexer mode is set Update by schedule. Kindly recheck the issue in Latest Magento 2.4-develop instance and elaborate the steps to reproduce if the issue is still reproducible. Thanks. |
Seems like you didn't read description properly. I have clearly mentioned attribute which have backend_type varchar, You are checking on attribute with backend_type integer. Also please create store scope attribute, not a global. Issue is reproducible from 2.1.x to latest Magento version 2.4.x. You can follow below step to reproduce issue.
Thanks. |
Hi @hiren-gujarati, Thanks for your update. Verified the issue on Magento 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots. We are getting 'All store view' value instned of store scope value. Hence Confirming the issue. Thanks. |
Thanks for checking and confirming issue. I have created following patch for temporary workaround, not sure is it correct approach or not so, attaching patch. --- a/vendor/magento/module-catalog/Model/Indexer/Product/Flat/TableBuilder.php
+++ b/vendor/magento/module-catalog/Model/Indexer/Product/Flat/TableBuilder.php
@@ -330,7 +330,8 @@
[]
);
- $columnValue = $this->_connection->getIfNullSql(
+ $columnValue = $this->_connection->getCheckSql(
+ 's' . $countTableName . '.value_id',
's' . $countTableName . '.value',
$countTableName . '.value'
); |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-11715 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Bravo. Thank you for verifying the issue. |
Preconditions and environment
Steps to reproduce
Use Default Value
checkbox and set empty/blank value in that varchar attributecatalog_product_flat_{store_id}
table after re-index dataYou can see global scope value in the flat table instated of store scope value but in the EAV table (
catalog_product_entity_varchar
) you can see store scope value. When indexer mode is set to Update on save thencatalog_product_flat_{store_id}
table have store scope value.Expected result
catalog_product_flat_{store_id}
should have store scope value when Indexer mode is set Update by schedule.Actual result
catalog_product_flat_{store_id}
have global scope value when product have attribute value on store scope.Additional information
Product flat re-indexer code have SQL query with getIfNullSql function which might replacing store scope null value with global scope value.
https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php#L333-L337
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: