This is an automated email from the ASF dual-hosted git repository.

mridulpathak pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 5b28f0c68e Fixed: uploadProductImages() silently drops every image 
after the first populated slot (OFBIZ-13625)
5b28f0c68e is described below

commit 5b28f0c68e94f1f7e23670bb9a61732a63c01481
Author: Mridul Pathak <[email protected]>
AuthorDate: Tue Sep 29 20:19:07 2026 +0530

    Fixed: uploadProductImages() silently drops every image after the first 
populated slot (OFBIZ-13625)
    
    Map addAdditionalViewForProductMap = parameters was a reference, not a 
copy, so once the first populated slot's block called .clear(), it cleared 
parameters itself. Every later if (parameters._additionalImageTwo_fileName) 
(through Ten) then read a cleared map and was skipped. Present since the 
original 2021 conversion. Now gives the map its own copy instead of aliasing 
parameters.
---
 .../product/imagemanagement/ImageManagementServicesScript.groovy        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/applications/product/src/main/groovy/org/apache/ofbiz/product/product/imagemanagement/ImageManagementServicesScript.groovy
 
b/applications/product/src/main/groovy/org/apache/ofbiz/product/product/imagemanagement/ImageManagementServicesScript.groovy
index 62e3c3fd41..117961c1a9 100644
--- 
a/applications/product/src/main/groovy/org/apache/ofbiz/product/product/imagemanagement/ImageManagementServicesScript.groovy
+++ 
b/applications/product/src/main/groovy/org/apache/ofbiz/product/product/imagemanagement/ImageManagementServicesScript.groovy
@@ -34,7 +34,7 @@ Map uploadProductImages() {
     Map result = success()
     Map serviceResult = [:]
     result.productId = parameters.productId
-    Map addAdditionalViewForProductMap = parameters
+    Map addAdditionalViewForProductMap = new HashMap<>(parameters)
     if (parameters._additionalImageOne_fileName) {
         addAdditionalViewForProductMap.productId = parameters.productId
         addAdditionalViewForProductMap.imageResize = parameters.imageResize

Reply via email to