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

jleroux 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 252c227  Fixed: variant product selection trashes image (OFBIZ-12019)
252c227 is described below

commit 252c227ad07e795f0c5227584806ca14dd72bcaa
Author: Jacques Le Roux <jacques.le.r...@les7arts.com>
AuthorDate: Tue Oct 6 15:16:58 2020 +0200

    Fixed: variant product selection trashes image (OFBIZ-12019)
    
    The variant products' images are being saved in the variable IMG encoded as 
urls,
    thus selecting the variant triggers an image override with an unsuitable 
file name.
    
    Thanks: Alex Bodnaru
---
 applications/order/groovyScripts/entry/catalog/ProductDetail.groovy | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/applications/order/groovyScripts/entry/catalog/ProductDetail.groovy 
b/applications/order/groovyScripts/entry/catalog/ProductDetail.groovy
index 7b5e234..2fe6325 100644
--- a/applications/order/groovyScripts/entry/catalog/ProductDetail.groovy
+++ b/applications/order/groovyScripts/entry/catalog/ProductDetail.groovy
@@ -349,8 +349,10 @@ if (product) {
                             contentWrapper = new 
ProductContentWrapper(imageMap[key], request)
 
                             // initial image paths
-                            detailImage = 
contentWrapper.get("DETAIL_IMAGE_URL", "url") ?: 
productContentWrapper.get("DETAIL_IMAGE_URL", "url")
-                            largeImage = contentWrapper.get("LARGE_IMAGE_URL", 
"url") ?: productContentWrapper.get("LARGE_IMAGE_URL", "url")
+                            detailImage = 
contentWrapper.getProductContentAsText(product, "DETAIL_IMAGE_URL", request, 
"string") 
+                            ?: productContentWrapper.get("DETAIL_IMAGE_URL", 
"string")
+                            largeImage = 
contentWrapper.getProductContentAsText(product, "LARGE_IMAGE_URL", request, 
"string") 
+                            ?: productContentWrapper.get("LARGE_IMAGE_URL", 
"string")
 
                             // full image URLs
                             detailImageUrl = null

Reply via email to