2.4.5 EE Graphql Product Collection flat table disabled #37334
Labels
Area: Catalog
Component: Catalog
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Priority: P2
A defect with this priority could have functionality issues which are not to expectations.
Progress: dev in progress
Project: GraphQL
Reported on 2.4.5
Indicates original Magento version for the Issue report.
Reproduced on 2.4.x
The issue has been reproduced on latest 2.4-develop branch
Triage: Dev.Experience
Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Preconditions and environment
Steps to reproduce
Go on
vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php
in theaddAttributeToSelect
method.On my project
$this->isEnabledFlat()
is always to false causing on some graphql request (add to cart) large execution times dues tovendor/magento/module-quote/Model/ResourceModel/Quote/Item/Collection.php
method_assignProducts
loading allquote_item
attributes.I found out that in the
vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php
constructor,\Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState
is passed.And the
$catalogProductFlatState->isAvailable()
method is alway false dues to the$isAvailable
instruction in the constructor false by default.I found out that in
vendor/magento/module-catalog/etc/frontend/di.xml
it's set to true :Or this is not set in any [...]/etc/graphql/di.xml
Fixing this on the module-catalog-graphql fix both issues. I dot found the correlation between $catalogProductFlatState and $_flatEnabled but it fix the issue. Maybe someone could give me more explanations...
Steps
Use Flat Catalog Category
andUse Flat Catalog Product
from admin panel on pathStores -> Settings -> Configuration -> Catalog -> Catalog -> Storefront
true
forisAvailable
:false
:Expected result
Flat should be enabled for collections on graphql scope
Actual result
Flat is not enabled for collections on graphql scope
Additional information
No response
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: