From 72a03eb758fc7970145580a56463db300284451f Mon Sep 17 00:00:00 2001 From: Mutesasira Moses Date: Fri, 25 Aug 2023 11:46:51 +0300 Subject: [PATCH] fix Updating image and image display --- .../service/servlet/reports/LogoUploadServiceImpl.java | 5 +++-- src/main/webapp/pages/siteinformation/siteInformation.jsp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/openelisglobal/common/service/servlet/reports/LogoUploadServiceImpl.java b/src/main/java/org/openelisglobal/common/service/servlet/reports/LogoUploadServiceImpl.java index 1abf9aaba9..4946f84c0c 100644 --- a/src/main/java/org/openelisglobal/common/service/servlet/reports/LogoUploadServiceImpl.java +++ b/src/main/java/org/openelisglobal/common/service/servlet/reports/LogoUploadServiceImpl.java @@ -31,11 +31,12 @@ public void saveImage(Image image, boolean newImage, String imageId, SiteInforma if (!newImage) { // The reason the old image is deleted and a new one added is because updating // the image doesn't work. + image.setId(imageId); imageService.delete(image); } - imageService.save(image); + Image savedImage = imageService.save(image); - logoInformation.setValue(image.getId()); + logoInformation.setValue(savedImage.getId()); logoInformation.setSysUserId("1"); siteInformationService.update(logoInformation); } diff --git a/src/main/webapp/pages/siteinformation/siteInformation.jsp b/src/main/webapp/pages/siteinformation/siteInformation.jsp index da6685258c..d5f9108923 100644 --- a/src/main/webapp/pages/siteinformation/siteInformation.jsp +++ b/src/main/webapp/pages/siteinformation/siteInformation.jsp @@ -79,7 +79,7 @@ -