This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch release17.12
in repository
https://gitbox.apache.org/repos/asf/ofbiz-framework.gitThe following commit(s) were added to refs/heads/release17.12 by this push:
new 8640250 Fixed: variant product selection trashes image (OFBIZ-12019)
8640250 is described below
commit 8640250331638ac56af1eca6d8b1b3bb9e1a8fd7
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 377e286..17bf430 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