{"data":{"id":"magento2-40251","source":"github-pr","sourceRef":"magento/magento2#40251","title":"Magento\\SalesRule\\Model\\Plugin\\QuoteConfigProductAttributes::afterGetProductAttributes getting triggered on all Cart Queries","pr":{"number":40251,"url":"https://github.com/magento/magento2/pull/40251","author":"senthilengg","mergedAt":"2026-06-05T06:49:53Z","mergeCommit":"9cce528d73a9c5eabbd96f81fbdb99006c3c7e5d","headCommit":"78eac7826bc05dea79bea4997148c1b1e6a24215","baseRef":"2.4-develop","diffSha256":"f84026c779d51f58207513e09bac800c9d7bbc31b3edea17e939a233d08c7aba"},"issues":[{"number":40226,"url":"https://github.com/magento/magento2/issues/40226","title":"Magento\\SalesRule\\Model\\Plugin\\QuoteConfigProductAttributes::afterGetProductAttributes getting triggered on all Cart Queries","labels":["Area: Catalog","Component: SalesRule","Issue: Confirmed","Priority: P3","Progress: PR Created","Progress: done","Reported on 2.4.x","Reproduced on 2.4.x","Triage: Dev.Experience"],"kind":"human"}],"fixedIn":null,"containingTags":[],"reportedOn":null,"codeMatch":{"2.4.6":"conflict","2.4.6-p1":"conflict","2.4.6-p2":"conflict","2.4.6-p3":"conflict","2.4.6-p4":"conflict","2.4.6-p5":"conflict","2.4.6-p6":"conflict","2.4.6-p7":"conflict","2.4.6-p8":"conflict","2.4.6-p9":"conflict","2.4.6-p10":"conflict","2.4.6-p11":"conflict","2.4.6-p12":"conflict","2.4.6-p13":"conflict","2.4.6-p14":"conflict","2.4.6-p15":"conflict","2.4.7":"conflict","2.4.7-p1":"conflict","2.4.7-p2":"conflict","2.4.7-p3":"conflict","2.4.7-p4":"conflict","2.4.7-p5":"conflict","2.4.7-p6":"conflict","2.4.7-p7":"conflict","2.4.7-p8":"conflict","2.4.7-p9":"conflict","2.4.7-p10":"conflict","2.4.8":"conflict","2.4.8-p1":"conflict","2.4.8-p2":"conflict","2.4.8-p3":"conflict","2.4.8-p4":"conflict","2.4.8-p5":"conflict","2.4.9":"clean"},"affectedVersions":["2.4.9"],"components":["magento/module-sales-rule"],"files":[{"path":"app/code/Magento/SalesRule/Model/Plugin/QuoteConfigProductAttributes.php","change":"modified","package":"magento/module-sales-rule"},{"path":"app/code/Magento/SalesRule/Model/Plugin/QuoteItemCollection.php","change":"added","package":"magento/module-sales-rule"},{"path":"app/code/Magento/SalesRule/Model/Plugin/ResourceModel/Rule.php","change":"modified","package":"magento/module-sales-rule"},{"path":"app/code/Magento/SalesRule/Model/ReadRequestFlag.php","change":"added","package":"magento/module-sales-rule"},{"path":"app/code/Magento/SalesRule/etc/di.xml","change":"modified","package":"magento/module-sales-rule"}],"stripped":{"tests":["app/code/Magento/SalesRule/Test/Unit/Model/Plugin/QuoteConfigProductAttributesTest.php","app/code/Magento/SalesRule/Test/Unit/Model/Plugin/QuoteItemCollectionTest.php","app/code/Magento/SalesRule/Test/Unit/Model/Plugin/ResourceModel/RuleTest.php","app/code/Magento/SalesRule/Test/Unit/Model/ReadRequestFlagTest.php"],"docs":[],"outsideCode":[]},"linesChanged":258,"mergeBatched":false,"excluded":null,"sections":{"description":"salesrule_product_attribute query fired always","stepsToReproduce":"1. Add products to cart (collectTotals should have completed here)\n2. Enable DB Query Log\n3. Hit the cart page URL\n4. To confirm the query fired run , cat var/log/db.log | grep \"salesrule_product_attribute\" from magento root","expectedResult":"salesrule_product_attribute query should be fired only when collectTotal happening","actualResult":"salesrule_product_attribute query fired always","source":"issue"},"signatures":[],"labels":{"area":["Catalog"],"component":["SalesRule"],"priority":"P3","severity":null,"reportedOn":["2.4.x"]},"categories":["Price/Tax","Shopping Cart"],"triage":{"model":"@cf/cloudflare/clef","requestHash":"1cc5a74329b999d722f18a0d122314ef145cdd848c6d6df5da48c4183631ebd8","isBugfix":0.9367,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.8981,"feature":0.0298,"refactor":0.0541,"tests_only":0.0085,"docs_only":0.004,"dependency":0.0055},"confidence":0.7725},"scope":{"score":1.4043,"probabilities":{"0":0.1444,"1":0.3069,"2":0.5487},"confidence":0.1242},"risk":{"score":1.3298,"probabilities":{"0":0.1904,"1":0.2894,"2":0.5202},"confidence":0.0859},"area":{"choice":"checkout","probabilities":{"catalog":0.0795,"checkout":0.7543,"customer":0.0082,"admin":0.024,"graphql_api":0.0231,"framework":0.0704,"frontend":0.0108,"other":0.0297},"confidence":0.5228},"securityRelevant":0.0073,"reportedVersion":{"choice":"unspecified","probabilities":{"2.4.0":0.0051,"2.4.0-p1":0.0045,"2.4.1":0.0037,"2.4.1-p1":0.0031,"2.4.2":0.0044,"2.4.2-p1":0.0037,"2.4.2-p2":0.005,"2.4.3":0.007,"2.4.3-p1":0.0067,"2.4.3-p2":0.0072,"2.4.3-p3":0.0057,"2.4.4":0.008,"2.4.4-p1":0.006,"2.4.4-p10":0.0051,"2.4.4-p11":0.0056,"2.4.4-p12":0.005,"2.4.4-p13":0.0053,"2.4.4-p14":0.0061,"2.4.4-p15":0.005,"2.4.4-p16":0.0057,"2.4.4-p17":0.0048,"2.4.4-p18":0.0044,"2.4.4-p2":0.0027,"2.4.4-p3":0.003,"2.4.4-p4":0.0033,"2.4.4-p5":0.0034,"2.4.4-p6":0.0038,"2.4.4-p7":0.0037,"2.4.4-p8":0.0038,"2.4.4-p9":0.0032,"2.4.5":0.0089,"2.4.5-p1":0.0075,"2.4.5-p10":0.0057,"2.4.5-p11":0.0085,"2.4.5-p12":0.0071,"2.4.5-p13":0.0073,"2.4.5-p14":0.0068,"2.4.5-p15":0.0059,"2.4.5-p16":0.0054,"2.4.5-p17":0.0062,"2.4.5-p2":0.0033,"2.4.5-p3":0.0041,"2.4.5-p4":0.0047,"2.4.5-p5":0.0047,"2.4.5-p6":0.0051,"2.4.5-p7":0.0048,"2.4.5-p8":0.0047,"2.4.5-p9":0.0035,"2.4.6":0.0154,"2.4.6-p1":0.0104,"2.4.6-p10":0.0096,"2.4.6-p11":0.0091,"2.4.6-p12":0.0075,"2.4.6-p13":0.0073,"2.4.6-p14":0.0091,"2.4.6-p15":0.0056,"2.4.6-p2":0.0042,"2.4.6-p3":0.0058,"2.4.6-p4":0.0071,"2.4.6-p5":0.0071,"2.4.6-p6":0.0059,"2.4.6-p7":0.0074,"2.4.6-p8":0.0051,"2.4.6-p9":0.0046,"2.4.7":0.0114,"2.4.7-p1":0.0097,"2.4.7-p10":0.0088,"2.4.7-p2":0.007,"2.4.7-p3":0.01,"2.4.7-p4":0.012,"2.4.7-p5":0.0094,"2.4.7-p6":0.0115,"2.4.7-p7":0.0095,"2.4.7-p8":0.0081,"2.4.7-p9":0.0061,"2.4.8":0.0137,"2.4.8-p1":0.0112,"2.4.8-p2":0.0139,"2.4.8-p3":0.0128,"2.4.8-p4":0.0126,"2.4.8-p5":0.0112,"2.4.9":0.0143,"unspecified":0.4374},"confidence":0.1861},"backportWorthy":{"score":0.9113,"probabilities":{"0":0.3317,"1":0.4254,"2":0.2429},"confidence":0.025}},"curated":{"title":"Fixes salesrule product attributes being queried on every cart request","description":"On the cart page the salesrule_product_attribute query is fired always, even when collectTotals is not happening. The QuoteConfigProductAttributes plugin now returns without salesrule attributes for GET and read requests and adds cache for the active attributes, and the cache is cleared on rule save when new attributes are inserted.","categories":["Shopping Cart","Price/Tax"],"author":"claude-code/opus-5.5","date":"2026-10-06","reviewedBy":null},"tests":{"2.4.9":{"before":"not-runnable","after":"error","adapted":false,"runAt":"2026-10-06T09:20:18.238Z","releaseCommit":"755e34dd689021c5165db9d35ecff74f7dc51527","suites":{"unit":{"before":"not-runnable","after":"error","runAt":"2026-10-06T09:20:18.238Z"}}}}},"_documentation":"https://magento.watch/api","_description":"Upstream fix magento2-40251 details"}