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; } }