{"data":{"id":"magento2-39680","source":"github-pr","sourceRef":"magento/magento2#39680","title":"Completely removing a gallery-image from be keeps scope roles/types set (base/small/thumbnail) and after re-adding \"old\" roles/types appear","pr":{"number":39680,"url":"https://github.com/magento/magento2/pull/39680","author":"pavel77718","mergedAt":"2025-06-26T06:32:13Z","mergeCommit":"2012df92fd43397331d94b67c2f4ed5535cf58cb","headCommit":"2596dd4b6e6bccee95408aca03346abf6040aff4","baseRef":"2.4-develop","diffSha256":"fd29b7103ee8decf5d60ddbb2febb6c3ec504973df84fb42d8cde5e76e0fed0d"},"issues":[{"number":39481,"url":"https://github.com/magento/magento2/issues/39481","title":"Completely removing a gallery-image from be keeps scope roles/types set (base/small/thumbnail) and after re-adding \"old\" roles/types appear","labels":["Area: Content / CMS","Component: Image","Issue: Confirmed","Priority: P3","Progress: done","Reported on 2.4.7","Reproduced on 2.4.x"],"kind":"human"}],"fixedIn":"2.4.9","containingTags":["2.4.9"],"reportedOn":"2.4.7","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":"conflict"},"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"],"components":["magento/module-catalog"],"files":[{"path":"app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js","change":"modified","package":"magento/module-catalog"}],"stripped":{"tests":[],"docs":[],"outsideCode":[]},"linesChanged":8,"mergeBatched":false,"excluded":null,"sections":{"description":"- if we previously removed the \"base\" type/role in a specific store-view, even if the image was completely removed from the gallery, after re-adding the image now in the specific store-scope the type/roles are the ones of the old (removed) image instead the ones of the default image (we expected inheritance)","stepsToReproduce":"- add a simple product\n- add an image in the default scope and select \"base\" type/role\n- make sure the type/role has been inherited by the store-scopes\n- remove or change types/roles in a store_view scope (i.e. remove the \"base\" type/role)\n- completely remove the gallery image (from scopes and from default)\n- re-add a new image in the default scope and flag the type/role \"base\"","expectedResult":"- in the store scopes the images inherit the roles/types of the new added image as per the default scope","actualResult":"- if we previously removed the \"base\" type/role in a specific store-view, even if the image was completely removed from the gallery, after re-adding the image now in the specific store-scope the type/roles are the ones of the old (removed) image instead the ones of the default image (we expected inheritance)","source":"issue"},"signatures":[],"labels":{"area":["Content / CMS"],"component":["Image"],"priority":"P3","severity":null,"reportedOn":["2.4.7"]},"categories":[],"triage":{"model":"@cf/cloudflare/clef","requestHash":"bbc0806d69e444a9cecae3497a1686891180319e41313d5eb8b7f2aca622f518","isBugfix":0.9787,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.9639,"feature":0.0054,"refactor":0.0094,"tests_only":0.0053,"docs_only":0.0035,"dependency":0.0035,"cleanup":0.009},"confidence":0.9177},"scope":{"score":0.433,"probabilities":{"0":0.642,"1":0.283,"2":0.075},"confidence":0.2468},"risk":{"score":0.4367,"probabilities":{"0":0.5903,"1":0.3827,"2":0.027},"confidence":0.2435},"area":{"choice":"admin","probabilities":{"catalog":0.4489,"checkout":0.0032,"customer":0.0025,"admin":0.4861,"graphql_api":0.0024,"framework":0.0064,"frontend":0.0435,"other":0.007},"confidence":0.3597},"securityRelevant":0.0058,"reportedVersion":{"choice":"2.4.7","probabilities":{"2.4.0":0.0024,"2.4.0-p1":0.0024,"2.4.1":0.0021,"2.4.1-p1":0.0023,"2.4.2":0.0024,"2.4.2-p1":0.0024,"2.4.2-p2":0.0027,"2.4.3":0.0032,"2.4.3-p1":0.0033,"2.4.3-p2":0.0034,"2.4.3-p3":0.0033,"2.4.4":0.003,"2.4.4-p1":0.0029,"2.4.4-p10":0.0034,"2.4.4-p11":0.0033,"2.4.4-p12":0.0036,"2.4.4-p13":0.0033,"2.4.4-p14":0.0035,"2.4.4-p15":0.0031,"2.4.4-p16":0.0032,"2.4.4-p17":0.0033,"2.4.4-p18":0.0029,"2.4.4-p2":0.0022,"2.4.4-p3":0.0024,"2.4.4-p4":0.0029,"2.4.4-p5":0.003,"2.4.4-p6":0.0035,"2.4.4-p7":0.0034,"2.4.4-p8":0.0034,"2.4.4-p9":0.0028,"2.4.5":0.0035,"2.4.5-p1":0.003,"2.4.5-p10":0.0029,"2.4.5-p11":0.0032,"2.4.5-p12":0.0039,"2.4.5-p13":0.0036,"2.4.5-p14":0.004,"2.4.5-p15":0.003,"2.4.5-p16":0.0042,"2.4.5-p17":0.0035,"2.4.5-p2":0.0026,"2.4.5-p3":0.0027,"2.4.5-p4":0.0033,"2.4.5-p5":0.0033,"2.4.5-p6":0.0035,"2.4.5-p7":0.0037,"2.4.5-p8":0.0034,"2.4.5-p9":0.0027,"2.4.6":0.0093,"2.4.6-p1":0.0143,"2.4.6-p10":0.0086,"2.4.6-p11":0.0085,"2.4.6-p12":0.0075,"2.4.6-p13":0.006,"2.4.6-p14":0.0068,"2.4.6-p15":0.0055,"2.4.6-p2":0.003,"2.4.6-p3":0.0037,"2.4.6-p4":0.0053,"2.4.6-p5":0.0047,"2.4.6-p6":0.0055,"2.4.6-p7":0.0062,"2.4.6-p8":0.0044,"2.4.6-p9":0.0032,"2.4.7":0.5682,"2.4.7-p1":0.0269,"2.4.7-p10":0.0123,"2.4.7-p2":0.0099,"2.4.7-p3":0.0117,"2.4.7-p4":0.0117,"2.4.7-p5":0.0105,"2.4.7-p6":0.0132,"2.4.7-p7":0.0123,"2.4.7-p8":0.0091,"2.4.7-p9":0.009,"2.4.8":0.0062,"2.4.8-p1":0.0068,"2.4.8-p2":0.0066,"2.4.8-p3":0.0074,"2.4.8-p4":0.007,"2.4.8-p5":0.0067,"2.4.9":0.0066,"unspecified":0.0064},"confidence":0.3181},"backportWorthy":{"score":1.5491,"probabilities":{"0":0.1037,"1":0.2435,"2":0.6528},"confidence":0.2443}},"curated":{"title":"Re-added product image gets the roles of the previously removed image","description":"If the base role was removed in a store view and the gallery image is then completely removed, after re-adding an image in the default scope the store view has the roles of the old image instead of inheritance. When an image is removed, product-gallery.js now sets each role/type select and its types value to no_selection.","categories":[],"author":"claude-code/opus-5.5","date":"2026-10-06","reviewedBy":null},"tests":null},"_documentation":"https://magento.watch/api","_description":"Upstream fix magento2-39680 details"}