MishkaCmsCore.Runtime.Resources.Changes.PublishPageDraft (Mishka CMS Core v0.0.1)

Copy Markdown View Source

After a :publish / :master_publish of a MishkaCmsCore.Runtime.PageDraft, writes the draft's fields to the live MishkaCmsCore.Runtime.Page — creating the page when the draft has no source_page_id, otherwise updating the existing page.

The write is scoped to the draft's site (tenant: draft.site_id, authorize?: false), so it behaves identically for master and tenant publishes and triggers the normal Page compile pipeline (Changes.SendToOban). It runs in an after_action, so a Page write failure (e.g. a duplicate path for a brand-new draft) rolls the whole publish transaction back and surfaces the error.

An existing page keeps its own code — MishkaCmsCore.Runtime.PageBuilder.CodeAccess.fields/0. The builder's code drawer writes it to the page directly, so a draft only holds the copy it forked.