Skip to content

fix: omit empty owner on JSON import (#22) - #23

Merged
ruibaby merged 2 commits into
mainfrom
fix/json-import-empty-owner-22
Nov 9, 2026
Merged

ruibaby merged 2 commits into
mainfrom
fix/json-import-empty-owner-22

Conversation

@ruibaby

@ruibaby ruibaby commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #22.

JSON ZIP import set post.spec.owner to an empty string in preparePostRequestForImport(). Halo's draftPost() only fills the current user when owner is null/absent, so the empty string was kept. PostReconciler then failed Subscription validation (subscriber name must be non-empty), imported drafts stayed invisible, and publish-after-import could hit HTTP 504.

Change

  • Stop assigning owner = '' during JSON import prep, matching Markdown/Word import which omit owner so Halo assigns the current user.

Why this is small-scope

One-line behavioral fix in a single UI helper; no API/schema or broader import redesign.

Test plan

  • Import a JSON ZIP without "publish after import"; post appears in admin list with a real owner; no repeating Subscription validation errors.
  • Import with "publish after import" checked; publish completes without 504 from this failure loop.
  • Confirm Markdown/Word import paths still behave as before.

… errors

Fixes #22

Halo draftPost() only fills the current user when owner is null/absent.
Setting owner to '' left posts with an empty owner, so PostReconciler
failed Subscription validation and imported drafts stayed invisible.
Empty string was kept by Halo draftPost() and broke Subscription validation.
delete leaves owner absent so the current user is filled. Fixes #22.
@ruibaby
ruibaby marked this pull request as ready for review November 9, 2026 06:30
@ruibaby
ruibaby merged commit f9c8c7e into main Nov 9, 2026
1 check passed
@ruibaby
ruibaby deleted the fix/json-import-empty-owner-22 branch November 9, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] JSON 导入 ZIP 后文章不可见,持续报 Subscription 校验错误

1 participant