{"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":"45c6250dddfb44046ca235430a5ac8ab63e13e7ae8a832f35e9ac0070540da7b","isBugfix":0.98,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.9732,"feature":0.0053,"refactor":0.0094,"tests_only":0.0049,"docs_only":0.0036,"dependency":0.0036},"confidence":0.9368},"scope":{"score":0.418,"probabilities":{"0":0.6502,"1":0.2815,"2":0.0683},"confidence":0.2601},"risk":{"score":0.4486,"probabilities":{"0":0.5754,"1":0.4006,"2":0.024},"confidence":0.2382},"area":{"choice":"admin","probabilities":{"catalog":0.4331,"checkout":0.0031,"customer":0.0025,"admin":0.5027,"graphql_api":0.0023,"framework":0.0061,"frontend":0.0438,"other":0.0064},"confidence":0.3627},"securityRelevant":0.0056,"reportedVersion":{"choice":"2.4.7","probabilities":{"2.4.0":0.0023,"2.4.0-p1":0.0023,"2.4.1":0.0021,"2.4.1-p1":0.0023,"2.4.2":0.0022,"2.4.2-p1":0.0024,"2.4.2-p2":0.0027,"2.4.3":0.003,"2.4.3-p1":0.0033,"2.4.3-p2":0.0032,"2.4.3-p3":0.0031,"2.4.4":0.0031,"2.4.4-p1":0.003,"2.4.4-p10":0.0034,"2.4.4-p11":0.0034,"2.4.4-p12":0.0033,"2.4.4-p13":0.0033,"2.4.4-p14":0.0034,"2.4.4-p15":0.0029,"2.4.4-p16":0.0032,"2.4.4-p17":0.0032,"2.4.4-p18":0.0028,"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.0032,"2.4.4-p7":0.0034,"2.4.4-p8":0.0032,"2.4.4-p9":0.0027,"2.4.5":0.0034,"2.4.5-p1":0.003,"2.4.5-p10":0.0029,"2.4.5-p11":0.0035,"2.4.5-p12":0.0046,"2.4.5-p13":0.004,"2.4.5-p14":0.0042,"2.4.5-p15":0.0031,"2.4.5-p16":0.0034,"2.4.5-p17":0.0033,"2.4.5-p2":0.0024,"2.4.5-p3":0.0026,"2.4.5-p4":0.0029,"2.4.5-p5":0.003,"2.4.5-p6":0.0034,"2.4.5-p7":0.0037,"2.4.5-p8":0.0029,"2.4.5-p9":0.0025,"2.4.6":0.0091,"2.4.6-p1":0.0116,"2.4.6-p10":0.0088,"2.4.6-p11":0.0078,"2.4.6-p12":0.0075,"2.4.6-p13":0.0064,"2.4.6-p14":0.0077,"2.4.6-p15":0.0055,"2.4.6-p2":0.003,"2.4.6-p3":0.0041,"2.4.6-p4":0.0054,"2.4.6-p5":0.0046,"2.4.6-p6":0.0049,"2.4.6-p7":0.0068,"2.4.6-p8":0.0045,"2.4.6-p9":0.0033,"2.4.7":0.5789,"2.4.7-p1":0.0288,"2.4.7-p10":0.0122,"2.4.7-p2":0.0093,"2.4.7-p3":0.0105,"2.4.7-p4":0.0101,"2.4.7-p5":0.0087,"2.4.7-p6":0.0119,"2.4.7-p7":0.012,"2.4.7-p8":0.0084,"2.4.7-p9":0.0078,"2.4.8":0.007,"2.4.8-p1":0.0067,"2.4.8-p2":0.0067,"2.4.8-p3":0.0072,"2.4.8-p4":0.0071,"2.4.8-p5":0.0062,"2.4.9":0.0069,"unspecified":0.0069},"confidence":0.3303},"backportWorthy":{"score":1.5474,"probabilities":{"0":0.1027,"1":0.2471,"2":0.6502},"confidence":0.2415}},"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"}