Skip to content

Empty varchar attribute store level value wrong save in flat catalog #38548

Open
@hiren-gujarati

Description

@hiren-gujarati

Preconditions and environment

  • Magento version: 2.4.6
  • Multi store setup
  • Enable Flat Catalog Product
  • Indexer mode: Update by schedule
  • Product attribute (backend_type: varchar, used_in_product_listing: true)

Steps to reproduce

  1. Save varchar attribute value on global scope
  2. Switch to store scope, uncheck Use Default Value checkbox and set empty/blank value in that varchar attribute
  3. Check catalog_product_flat_{store_id} table after re-index data

You 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 then catalog_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

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: ProductComponent: DBIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: ready for devReported on 2.4.6Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions