Micropub: articles posted as drafts (post-status: draft) are published immediately #123
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
iA Writer (and other Micropub clients) can mark a post as a draft via the
post-statusproperty. Our Micropub pipeline ignores this entirely — every article created via Micropub is published straight away, regardless of what the client sends.Root cause
EntryData(app/Services/Micropub/Data/EntryData.php) never extractspost-statusfrom either the JSON or form-encoded request body — there's nopostStatusfield on the DTO at all.ArticleService::create()(app/Services/ArticleService.php) hardcodes'published' => trueon every createdArticle, so there's no path for a draft to land as unpublished even if the data were available.The
Articlemodel, admin UI, and public listing (ArticlesController::indexfilters onpublished) already fully support a published flag — this is purely a gap in the Micropub ingestion path.Expected behavior
A Micropub request with
post-status: draftshould create anArticlewithpublished = false. Omittingpost-status, or sendingpost-status: published, should keep today's behavior (published = true).Suggested fix
postStatus(or similar) field toEntryData::fromRequest/fromArray/toArray, readingproperties.post-status.0(JSON) /post-status(form).ArticleService::create(), set published based on that value instead of hardcoding true.post-status: draftresults in an unpublishedArticle; withpost-status: publishedor omitted, results in a published one.Out of scope
Notes/bookmarks/likes don't have a draft concept today — this ticket is just about articles.