From b61d24d7bd5a393d6c637fab5d82c12e2f92d5d0 Mon Sep 17 00:00:00 2001 From: johnniang Date: Sat, 27 Apr 2019 00:19:51 +0800 Subject: [PATCH] Fix migration bug --- src/main/java/run/halo/app/model/entity/Attachment.java | 1 - .../java/run/halo/app/service/impl/RecoveryServiceImpl.java | 2 +- src/main/resources/templates/themes/anatole/module/page-top.ftl | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/run/halo/app/model/entity/Attachment.java b/src/main/java/run/halo/app/model/entity/Attachment.java index 879367787..46a21c55e 100644 --- a/src/main/java/run/halo/app/model/entity/Attachment.java +++ b/src/main/java/run/halo/app/model/entity/Attachment.java @@ -92,7 +92,6 @@ public class Attachment extends BaseEntity { @Override public void prePersist() { super.prePersist(); - id = null; if (fileKey == null) { fileKey = ""; diff --git a/src/main/java/run/halo/app/service/impl/RecoveryServiceImpl.java b/src/main/java/run/halo/app/service/impl/RecoveryServiceImpl.java index 4dbf6e447..380b0ef9d 100644 --- a/src/main/java/run/halo/app/service/impl/RecoveryServiceImpl.java +++ b/src/main/java/run/halo/app/service/impl/RecoveryServiceImpl.java @@ -440,7 +440,7 @@ public class RecoveryServiceImpl implements RecoveryService { } // Set location - String attachLocation = attachmentMap.get("attachLocation").toString(); + String attachLocation = attachmentMap.getOrDefault("attachLocation", "").toString(); if (StringUtils.equalsIgnoreCase(attachLocation, "qiniu")) { attachment.setType(AttachmentType.QNYUN); } else if (StringUtils.equalsIgnoreCase(attachLocation, "upyun")) { diff --git a/src/main/resources/templates/themes/anatole/module/page-top.ftl b/src/main/resources/templates/themes/anatole/module/page-top.ftl index 18850a8a2..10b2062c5 100644 --- a/src/main/resources/templates/themes/anatole/module/page-top.ftl +++ b/src/main/resources/templates/themes/anatole/module/page-top.ftl @@ -1,7 +1,7 @@