{"data":{"id":"magento2-40827","source":"github-pr","sourceRef":"magento/magento2#40827","title":"EAV Select and Multiselect attribute validation incorrectly rejects option labels with the value \"0\"","pr":{"number":40827,"url":"https://github.com/magento/magento2/pull/40827","author":"lbajsarowicz","mergedAt":"2026-08-31T09:21:05Z","mergeCommit":"cbadd425038049f6ef59481a7c3d4e0ba6cc7635","headCommit":"d97dbc6ecd2c4a8a2c7c70f7c73b96bcecd34a3e","baseRef":"2.4-develop","diffSha256":"d4e94b0e9471ee7a36d6898365aae05386eaace0f38ff09fcc27ad5af241fada"},"issues":[{"number":40634,"url":"https://github.com/magento/magento2/issues/40634","title":"EAV Select and Multiselect attribute validation incorrectly rejects option labels with the value \"0\"","labels":["Area: Product","Component: Eav","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":"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-eav"],"files":[{"path":"app/code/Magento/Eav/Model/Attribute/Data/Multiselect.php","change":"modified","package":"magento/module-eav"},{"path":"app/code/Magento/Eav/Model/Attribute/Data/Select.php","change":"modified","package":"magento/module-eav"}],"stripped":{"tests":["app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/MultiselectTest.php","app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/SelectTest.php"],"docs":[],"outsideCode":[]},"linesChanged":19,"mergeBatched":false,"excluded":null,"sections":{"description":"Validation fails (or the value is treated as invalid) because `!\"0\"` evaluates to `true` in PHP.","stepsToReproduce":"1. Create an EAV Select or Multiselect attribute.\n2. Add an option whose **label is set to** `0`.\n3. Attempt to save an entity (e.g. a customer or product) using that option value.","expectedResult":"The value is accepted as valid, since the option exists and has a label.","actualResult":"Validation fails (or the value is treated as invalid) because `!\"0\"` evaluates to `true` in PHP.","source":"issue"},"signatures":[],"labels":{"area":["Product"],"component":["Eav"],"priority":"P3","severity":null,"reportedOn":["2.4.x"]},"categories":["Catalog/Product"],"triage":{"model":"@cf/cloudflare/clef","requestHash":"9388cde3a4e96bd4db1841b8db256f8af277875e79e6ce11cff21e6195fb0d38","isBugfix":0.9838,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.9737,"feature":0.0047,"refactor":0.0092,"tests_only":0.0062,"docs_only":0.0031,"dependency":0.0031},"confidence":0.9378},"scope":{"score":0.7772,"probabilities":{"0":0.3311,"1":0.5607,"2":0.1082},"confidence":0.1535},"risk":{"score":0.1558,"probabilities":{"0":0.8775,"1":0.0892,"2":0.0333},"confidence":0.6686},"area":{"choice":"catalog","probabilities":{"catalog":0.8391,"checkout":0.0053,"customer":0.0177,"admin":0.0467,"graphql_api":0.0039,"framework":0.0474,"frontend":0.0047,"other":0.0352},"confidence":0.6687},"securityRelevant":0.0056,"reportedVersion":{"choice":"unspecified","probabilities":{"2.4.0":0.0043,"2.4.0-p1":0.0036,"2.4.1":0.0041,"2.4.1-p1":0.0036,"2.4.2":0.0059,"2.4.2-p1":0.0059,"2.4.2-p2":0.0067,"2.4.3":0.0082,"2.4.3-p1":0.0067,"2.4.3-p2":0.0077,"2.4.3-p3":0.0053,"2.4.4":0.0117,"2.4.4-p1":0.0072,"2.4.4-p10":0.0056,"2.4.4-p11":0.0065,"2.4.4-p12":0.0057,"2.4.4-p13":0.0061,"2.4.4-p14":0.007,"2.4.4-p15":0.005,"2.4.4-p16":0.0061,"2.4.4-p17":0.0055,"2.4.4-p18":0.0044,"2.4.4-p2":0.0024,"2.4.4-p3":0.0027,"2.4.4-p4":0.0032,"2.4.4-p5":0.0044,"2.4.4-p6":0.0039,"2.4.4-p7":0.0049,"2.4.4-p8":0.0043,"2.4.4-p9":0.004,"2.4.5":0.0128,"2.4.5-p1":0.0113,"2.4.5-p10":0.0074,"2.4.5-p11":0.011,"2.4.5-p12":0.0088,"2.4.5-p13":0.0076,"2.4.5-p14":0.0102,"2.4.5-p15":0.0073,"2.4.5-p16":0.0072,"2.4.5-p17":0.0078,"2.4.5-p2":0.003,"2.4.5-p3":0.0056,"2.4.5-p4":0.0059,"2.4.5-p5":0.0061,"2.4.5-p6":0.0065,"2.4.5-p7":0.0054,"2.4.5-p8":0.0059,"2.4.5-p9":0.005,"2.4.6":0.0265,"2.4.6-p1":0.0159,"2.4.6-p10":0.0098,"2.4.6-p11":0.0121,"2.4.6-p12":0.0103,"2.4.6-p13":0.0107,"2.4.6-p14":0.0108,"2.4.6-p15":0.0076,"2.4.6-p2":0.004,"2.4.6-p3":0.0088,"2.4.6-p4":0.008,"2.4.6-p5":0.0085,"2.4.6-p6":0.0076,"2.4.6-p7":0.008,"2.4.6-p8":0.0074,"2.4.6-p9":0.0057,"2.4.7":0.0196,"2.4.7-p1":0.0139,"2.4.7-p10":0.0109,"2.4.7-p2":0.0064,"2.4.7-p3":0.0118,"2.4.7-p4":0.0143,"2.4.7-p5":0.0119,"2.4.7-p6":0.0125,"2.4.7-p7":0.0111,"2.4.7-p8":0.0099,"2.4.7-p9":0.0075,"2.4.8":0.0211,"2.4.8-p1":0.017,"2.4.8-p2":0.0177,"2.4.8-p3":0.0154,"2.4.8-p4":0.0166,"2.4.8-p5":0.0122,"2.4.9":0.0188,"unspecified":0.2923},"confidence":0.0822},"backportWorthy":{"score":1.4524,"probabilities":{"0":0.1277,"1":0.2921,"2":0.5802},"confidence":0.1573}},"curated":{"title":"Fixes Select and Multiselect attribute validation rejecting an option labelled 0","description":"A valid option whose label is literally 0 is rejected with 'Attribute X does not contain option with Id Y', because the loose boolean check on the option text treats the string 0 as falsy. Select::validateValue() and Multiselect::validateBySource() now report the error only when the option text is false or null.","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":true,"runAt":"2026-10-06T09:20:29.119Z","releaseCommit":"870a22c63d9d9b68fa3297962e2d5d5841115814","suites":{"unit":{"before":"fail","after":"pass","runAt":"2026-10-06T09:20:29.119Z"}}},"2.4.9":{"before":"fail","after":"pass","adapted":false,"runAt":"2026-10-06T09:20:28.442Z","releaseCommit":"755e34dd689021c5165db9d35ecff74f7dc51527","suites":{"unit":{"before":"fail","after":"pass","runAt":"2026-10-06T09:20:28.442Z"}}},"2.4.7-p10":{"before":"not-runnable","after":"error","adapted":true,"runAt":"2026-10-06T09:29:35.211Z","releaseCommit":"72561bf80652f57cc642a03e2c9a51d74a285b14","suites":{"unit":{"before":"not-runnable","after":"error","runAt":"2026-10-06T09:29:35.211Z"}}}}},"_documentation":"https://magento.watch/api","_description":"Upstream fix magento2-40827 details"}