From bd846bfc8dc38bd4ecebefb539442f009829a666 Mon Sep 17 00:00:00 2001 From: Trisha Anand Date: Tue, 5 Nov 2019 07:37:39 +0000 Subject: [PATCH] Fix for dsl getting rewritten --- .../java/com/appsmith/server/services/LayoutServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/LayoutServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/LayoutServiceImpl.java index 995cfeb115..5e14a2552f 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/LayoutServiceImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/LayoutServiceImpl.java @@ -6,6 +6,7 @@ import com.appsmith.server.domains.Page; import com.appsmith.server.exceptions.AppsmithError; import com.appsmith.server.exceptions.AppsmithException; import lombok.extern.slf4j.Slf4j; +import net.minidev.json.JSONObject; import org.bson.types.ObjectId; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -79,8 +80,10 @@ public class LayoutServiceImpl implements LayoutService { //Because the findByIdAndLayoutsId call returned non-empty result, we are guaranteed to find the layoutId here. for (Layout storedLayout : layoutList) { if (storedLayout.getId().equals(layoutId)) { + JSONObject publishedDsl = storedLayout.getPublishedDsl(); BeanUtils.copyProperties(layout, storedLayout); storedLayout.setId(layoutId); + storedLayout.setPublishedDsl(publishedDsl); break; } }