Fixed: Uploading images at catalog/control/addImageForProduct does not work
Delegator was fetched from the context instead of the DispatchContext and thus
was throwing NPE while running the EntityUtilProperties.getPropertyValue().
Thanks: Devanshu Vyas
@@ -337,8 +337,8 @@ public class ImageManagementServices {
index = filenameToUse.lastIndexOf(".");
String imgExtension = filenameToUse.substring(index + 1);
// paths
- String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", (Delegator) context.get("delegator")), context);
- String imageServerUrl = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.url", (Delegator) context.get("delegator")), context);
+ String imageServerPath = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.path", dctx.getDelegator()), context);
+ String imageServerUrl = FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog", "image.management.url", dctx.getDelegator()), context);
/* get original BUFFERED IMAGE */
