[ofbiz-framework] branch release18.12 updated: Fixed: variant product selection trashes image (OFBIZ-12019)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch release18.12 updated: Fixed: variant product selection trashes image (OFBIZ-12019)

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/release18.12 by this push:
     new 15dc81a  Fixed: variant product selection trashes image (OFBIZ-12019)
15dc81a is described below

commit 15dc81a8024d093dd88155f145322a40abe8fb06
Author: Jacques Le Roux <[hidden email]>
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 2d4a2f2..ceffb2c 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