{"data":{"id":"magento2-40419","source":"github-pr","sourceRef":"magento/magento2#40419","title":"Unable to get product collection scoped `decimal` attribute if price is globally scoped","pr":{"number":40419,"url":"https://github.com/magento/magento2/pull/40419","author":"KrasnoshchokBohdan","mergedAt":"2026-05-20T15:36:42Z","mergeCommit":"af44dc868bd6785c6c9556f8900176646823b23f","headCommit":"188c920a44a032d83484b125f3d69d7e0841d1d2","baseRef":"2.4-develop","diffSha256":"d6307645e7ee978a7b64bc4a34422529cea1b716506c15f2b77fe8d390fe7820"},"issues":[{"number":40218,"url":"https://github.com/magento/magento2/issues/40218","title":"Unable to get product collection scoped `decimal` attribute if price is globally scoped","labels":["Area: Catalog","Component: Attributes","Issue: Confirmed","Priority: P3","Progress: PR Created","Progress: done","Reported on 2.4.8-p2","Reproduced on 2.4.x","Triage: Dev.Experience"],"kind":"human"}],"fixedIn":null,"containingTags":[],"reportedOn":"2.4.8-p2","codeMatch":{"2.4.6":"clean","2.4.6-p1":"clean","2.4.6-p2":"clean","2.4.6-p3":"clean","2.4.6-p4":"clean","2.4.6-p5":"clean","2.4.6-p6":"clean","2.4.6-p7":"clean","2.4.6-p8":"clean","2.4.6-p9":"clean","2.4.6-p10":"clean","2.4.6-p11":"clean","2.4.6-p12":"clean","2.4.6-p13":"clean","2.4.6-p14":"clean","2.4.6-p15":"clean","2.4.7":"clean","2.4.7-p1":"clean","2.4.7-p2":"clean","2.4.7-p3":"clean","2.4.7-p4":"clean","2.4.7-p5":"clean","2.4.7-p6":"clean","2.4.7-p7":"clean","2.4.7-p8":"clean","2.4.7-p9":"clean","2.4.7-p10":"clean","2.4.8":"clean","2.4.8-p1":"clean","2.4.8-p2":"clean","2.4.8-p3":"clean","2.4.8-p4":"clean","2.4.8-p5":"clean","2.4.9":"clean"},"affectedVersions":["2.4.6","2.4.6-p1","2.4.6-p2","2.4.6-p3","2.4.6-p4","2.4.6-p5","2.4.6-p6","2.4.6-p7","2.4.6-p8","2.4.6-p9","2.4.6-p10","2.4.6-p11","2.4.6-p12","2.4.6-p13","2.4.6-p14","2.4.6-p15","2.4.7","2.4.7-p1","2.4.7-p2","2.4.7-p3","2.4.7-p4","2.4.7-p5","2.4.7-p6","2.4.7-p7","2.4.7-p8","2.4.7-p9","2.4.7-p10","2.4.8","2.4.8-p1","2.4.8-p2","2.4.8-p3","2.4.8-p4","2.4.8-p5","2.4.9"],"components":["magento/module-catalog"],"files":[{"path":"app/code/Magento/Catalog/Model/ResourceModel/Collection/AbstractCollection.php","change":"modified","package":"magento/module-catalog"}],"stripped":{"tests":["app/code/Magento/Catalog/Test/Fixture/ProductGlobalPriceStoreScopedDecimal.php","dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php"],"docs":[],"outsideCode":[]},"linesChanged":12,"mergeBatched":false,"excluded":null,"sections":{"description":"Loaded products in collection does not have `example*decimal*attr` values. If we remove `price` from collection attributes select, then it works as expected.\nThis works:\n```\n$collection->setStoreId(1);\n$collection->addAttributeToSelect('example*decimal*attr');\n$collection->load();\n```\nAdding `$collection->addAttributeToSelect('price');` before loading collection, causes bug, that `example*decimal*attr` values are not present.","stepsToReproduce":"Problem is pretty straightforward.\n1. Set price as global (it's by default)\n1. Add decimal scoped attribute `example*decimal*attr`\n1. Set decimal attribute value on some products on store scope (not global - store_id > 0)\n1. Create product collection for scope where created attribute have value (i.e. store_id = 1)\n1. Add attributes to select:\n```\n$collection->setStoreId(1);\n$collection->addAttributeToSelect('example*decimal*attr');\n$collection->addAttributeToSelect('price');\n$collection->load();\n```","expectedResult":"Loaded products in collection have `example*decimal*attr` values.","actualResult":"Loaded products in collection does not have `example*decimal*attr` values. If we remove `price` from collection attributes select, then it works as expected.\nThis works:\n```\n$collection->setStoreId(1);\n$collection->addAttributeToSelect('example*decimal*attr');\n$collection->load();\n```\nAdding `$collection->addAttributeToSelect('price');` before loading collection, causes bug, that `example*decimal*attr` values are not present.","source":"issue"},"signatures":[],"labels":{"area":["Catalog"],"component":["Attributes"],"priority":"P3","severity":null,"reportedOn":["2.4.8-p2"]},"categories":["Catalog/Product"],"triage":{"model":"@cf/cloudflare/clef","requestHash":"0fb1f1906877934cdfd3289c8e38f8a06c9e7a62b37026af73b1e2812c55b599","isBugfix":0.9802,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.9604,"feature":0.0063,"refactor":0.0171,"tests_only":0.0092,"docs_only":0.0033,"dependency":0.0037},"confidence":0.9074},"scope":{"score":0.8493,"probabilities":{"0":0.3588,"1":0.4331,"2":0.2081},"confidence":0.0394},"risk":{"score":0.9048,"probabilities":{"0":0.3874,"1":0.3205,"2":0.2921},"confidence":0.0072},"area":{"choice":"catalog","probabilities":{"catalog":0.9374,"checkout":0.0111,"customer":0.0051,"admin":0.0137,"graphql_api":0.0059,"framework":0.012,"frontend":0.009,"other":0.0058},"confidence":0.8621},"securityRelevant":0.0077,"reportedVersion":{"choice":"2.4.8-p2","probabilities":{"2.4.0":0.0021,"2.4.0-p1":0.0025,"2.4.1":0.0023,"2.4.1-p1":0.0026,"2.4.2":0.0024,"2.4.2-p1":0.0027,"2.4.2-p2":0.0033,"2.4.3":0.0023,"2.4.3-p1":0.0029,"2.4.3-p2":0.0037,"2.4.3-p3":0.0029,"2.4.4":0.0026,"2.4.4-p1":0.0029,"2.4.4-p10":0.0038,"2.4.4-p11":0.0042,"2.4.4-p12":0.0039,"2.4.4-p13":0.0038,"2.4.4-p14":0.0046,"2.4.4-p15":0.0033,"2.4.4-p16":0.0032,"2.4.4-p17":0.0031,"2.4.4-p18":0.003,"2.4.4-p2":0.0029,"2.4.4-p3":0.0024,"2.4.4-p4":0.0027,"2.4.4-p5":0.0028,"2.4.4-p6":0.003,"2.4.4-p7":0.0028,"2.4.4-p8":0.0039,"2.4.4-p9":0.0028,"2.4.5":0.0025,"2.4.5-p1":0.0028,"2.4.5-p10":0.0029,"2.4.5-p11":0.0034,"2.4.5-p12":0.0047,"2.4.5-p13":0.0038,"2.4.5-p14":0.0041,"2.4.5-p15":0.0032,"2.4.5-p16":0.0035,"2.4.5-p17":0.0033,"2.4.5-p2":0.0032,"2.4.5-p3":0.0028,"2.4.5-p4":0.0031,"2.4.5-p5":0.0033,"2.4.5-p6":0.0037,"2.4.5-p7":0.0033,"2.4.5-p8":0.0038,"2.4.5-p9":0.0028,"2.4.6":0.0038,"2.4.6-p1":0.0043,"2.4.6-p10":0.0051,"2.4.6-p11":0.0059,"2.4.6-p12":0.0057,"2.4.6-p13":0.0048,"2.4.6-p14":0.0049,"2.4.6-p15":0.0044,"2.4.6-p2":0.0037,"2.4.6-p3":0.0036,"2.4.6-p4":0.0046,"2.4.6-p5":0.004,"2.4.6-p6":0.0059,"2.4.6-p7":0.0049,"2.4.6-p8":0.0049,"2.4.6-p9":0.0031,"2.4.7":0.0062,"2.4.7-p1":0.0052,"2.4.7-p10":0.0057,"2.4.7-p2":0.0055,"2.4.7-p3":0.0067,"2.4.7-p4":0.0074,"2.4.7-p5":0.0058,"2.4.7-p6":0.0107,"2.4.7-p7":0.0057,"2.4.7-p8":0.0054,"2.4.7-p9":0.003,"2.4.8":0.0159,"2.4.8-p1":0.0122,"2.4.8-p2":0.6274,"2.4.8-p3":0.0197,"2.4.8-p4":0.0109,"2.4.8-p5":0.0102,"2.4.9":0.0075,"unspecified":0.0037},"confidence":0.3886},"backportWorthy":{"score":1.5968,"probabilities":{"0":0.0698,"1":0.2636,"2":0.6666},"confidence":0.2781}},"curated":{"title":"Fixes store-scoped decimal attributes returning default values with price","description":"In a product collection, store-scoped decimal attributes failed to load their store-specific values when the globally scoped price attribute was also selected. A loop in _getLoadAttributesSelect() set the store id to the default store for all attributes. The fix removes that loop.","categories":["Catalog/Product"],"author":"claude-code/opus-5.5","date":"2026-10-06","reviewedBy":null},"tests":{"2.4.8-p5":{"before":"fail","after":"pass","adapted":false,"runAt":"2026-10-06T09:34:15.030Z","releaseCommit":"870a22c63d9d9b68fa3297962e2d5d5841115814","suites":{"integration":{"before":"fail","after":"pass","runAt":"2026-10-06T09:34:15.030Z"}}},"2.4.9":{"before":"fail","after":"pass","adapted":false,"runAt":"2026-10-06T09:33:58.927Z","releaseCommit":"755e34dd689021c5165db9d35ecff74f7dc51527","suites":{"integration":{"before":"fail","after":"pass","runAt":"2026-10-06T09:33:58.927Z"}}},"2.4.7-p10":{"before":"fail","after":"pass","adapted":false,"runAt":"2026-10-06T09:59:05.190Z","releaseCommit":"72561bf80652f57cc642a03e2c9a51d74a285b14","suites":{"integration":{"before":"fail","after":"pass","runAt":"2026-10-06T09:59:05.190Z"}}}}},"_documentation":"https://magento.watch/api","_description":"Upstream fix magento2-40419 details"}