mirror of https://github.com/halo-dev/halo
fix: cannot be published successfully after post or single page unpublished (#2762)
#### What type of PR is this? /kind bug /area core /milestone 2.0.0-rc.1 #### What this PR does / why we need it: 修复文章和自定义页面取消发布后无法再继续发布的问题 #### Special notes for yourd reviewer: how to test it? 1. create a post and publsih it 2. unpublish it then republish 3. excepted to b published successfully /cc @halo-dev/sig-halo #### Does this PR introduce a user-facing change? ```release-note None ```pull/2763/head v2.0.0-rc.1
parent
12fd77f61f
commit
16e4e46e40
|
@ -104,8 +104,10 @@ public class PostReconciler implements Reconciler<Reconciler.Request> {
|
||||||
if (StringUtils.isBlank(releaseSnapshot)) {
|
if (StringUtils.isBlank(releaseSnapshot)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// do nothing if release snapshot is not changed
|
|
||||||
if (StringUtils.equals(lastReleasedSnapshot, releaseSnapshot)) {
|
// do nothing if release snapshot is not changed and post is published
|
||||||
|
if (post.isPublished()
|
||||||
|
&& StringUtils.equals(lastReleasedSnapshot, releaseSnapshot)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Post.PostStatus status = post.getStatusOrDefault();
|
Post.PostStatus status = post.getStatusOrDefault();
|
||||||
|
|
|
@ -108,8 +108,9 @@ public class SinglePageReconciler implements Reconciler<Reconciler.Request> {
|
||||||
if (StringUtils.isBlank(releaseSnapshot)) {
|
if (StringUtils.isBlank(releaseSnapshot)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// do nothing if release snapshot is not changed
|
// do nothing if release snapshot is not changed and page is published
|
||||||
if (StringUtils.equals(lastReleasedSnapshot, releaseSnapshot)) {
|
if (page.isPublished()
|
||||||
|
&& StringUtils.equals(lastReleasedSnapshot, releaseSnapshot)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SinglePage.SinglePageStatus status = page.getStatusOrDefault();
|
SinglePage.SinglePageStatus status = page.getStatusOrDefault();
|
||||||
|
|
Loading…
Reference in New Issue