From 596503a04373ad21bdde6fd591974c167f36f93d Mon Sep 17 00:00:00 2001 From: Bahlai Pavlo Date: Fri, 28 Feb 2025 14:43:24 +0200 Subject: [PATCH 1/5] magento/magento2#39481: Completely removing a gallery-image from be keeps scope roles/types set (base/small/thumbnail) and after re-adding "old" roles/types appear - fixed issue with "old" roles/types after re-adding images --- .../Magento/Catalog/view/adminhtml/web/js/product-gallery.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js b/app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js index c281e780d9173..2796fb476ec31 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js @@ -355,6 +355,11 @@ define([ imageData.isRemoved = true; $imageContainer.addClass('removed').hide().find('.is-removed').val(1); + $.each(this.options.types, $.proxy(function (index, type) { + this.element.find('.image-' + type.code).val('no_selection'); + this.options.types[index].value = 'no_selection'; + }, this)); + this._contentUpdated(); }, From baf8e32f2d7c7f2152ac751e496baf8ced33e7fe Mon Sep 17 00:00:00 2001 From: Bahlai Pavlo Date: Fri, 28 Feb 2025 15:59:15 +0200 Subject: [PATCH 2/5] magento/magento2#39481: Completely removing a gallery-image from be keeps scope roles/types set (base/small/thumbnail) and after re-adding "old" roles/types appear - changed copyright --- .../Magento/Catalog/view/adminhtml/web/js/product-gallery.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js b/app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js index 2796fb476ec31..0a4baa2dc40e8 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js @@ -1,6 +1,6 @@ /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. + * Copyright 2015 Adobe + * All Rights Reserved. */ /** From 8b59433d9fbd7fac86c0527476d688e8895c8f64 Mon Sep 17 00:00:00 2001 From: Bahlai Pavlo Date: Mon, 3 Mar 2025 14:52:23 +0200 Subject: [PATCH 3/5] magento/magento2#39640: Completely removing a gallery-image from be keeps scope roles/types set (base/small/thumbnail) and after re-adding "old" roles/types appear - rolled back a file that was changed by mistake for another issue --- .../view/adminhtml/web/js/product-gallery.js | 9 ++------- .../view/base/web/js/dynamic-rows/dynamic-rows.js | 15 +++++++-------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js b/app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js index 0a4baa2dc40e8..c281e780d9173 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js @@ -1,6 +1,6 @@ /** - * Copyright 2015 Adobe - * All Rights Reserved. + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. */ /** @@ -355,11 +355,6 @@ define([ imageData.isRemoved = true; $imageContainer.addClass('removed').hide().find('.is-removed').val(1); - $.each(this.options.types, $.proxy(function (index, type) { - this.element.find('.image-' + type.code).val('no_selection'); - this.options.types[index].value = 'no_selection'; - }, this)); - this._contentUpdated(); }, diff --git a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js index c0606e44e964f..243f4a8de293c 100644 --- a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js +++ b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js @@ -1,6 +1,6 @@ /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. + * Copyright 2015 Adobe + * All Rights Reserved. */ /** @@ -691,12 +691,11 @@ define([ processingAddChild: function (ctx, index, prop) { this.bubble('addChild', false); - if (this.relatedData.length && this.relatedData.length % this.pageSize === 0) { - this.pages(this.pages() + 1); - this.nextPage(); - } else if (~~this.currentPage() !== this.pages()) { - this.currentPage(this.pages()); - } + var newTotal = this.relatedData.length + 1; + var newPages = Math.ceil(newTotal / this.pageSize); + + this.pages(newPages); + this.currentPage(newPages); this.addChild(ctx, index, prop); }, From 01ef9889f3f0406bd6bbe4710cd1917ddff775da Mon Sep 17 00:00:00 2001 From: Bahlai Pavlo Date: Tue, 4 Mar 2025 14:23:48 +0200 Subject: [PATCH 4/5] magento/magento2#39640: Issue with the Customizable Options grid on the product page in the admin panel - fixed "var" declaration in method --- .../Ui/view/base/web/js/dynamic-rows/dynamic-rows.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js index 243f4a8de293c..8d88e49fb30d4 100644 --- a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js +++ b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js @@ -689,10 +689,13 @@ define([ * @param {Number|String} prop - additional property to element */ processingAddChild: function (ctx, index, prop) { + var newTotal, + newPages; + this.bubble('addChild', false); - var newTotal = this.relatedData.length + 1; - var newPages = Math.ceil(newTotal / this.pageSize); + newTotal = this.relatedData.length + 1; + newPages = Math.ceil(newTotal / this.pageSize); this.pages(newPages); this.currentPage(newPages); From 93e0a343911723537ddf78c36b75a3a1bb5cac1d Mon Sep 17 00:00:00 2001 From: Bahlai Pavlo Date: Tue, 8 Apr 2025 17:04:09 +0300 Subject: [PATCH 5/5] magento/magento2#39640: Issue with the Customizable Options grid on the product page in the admin panel - changed copyright --- .../Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js index 8d88e49fb30d4..8b4aeab762e13 100644 --- a/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js +++ b/app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js @@ -1,5 +1,5 @@ /** - * Copyright 2015 Adobe + * Copyright 2016 Adobe * All Rights Reserved. */