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

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.Authoring.CodeAccess.fields/0. The builder's code drawer writes it to the page directly, so a draft only holds the copy it forked.

Summary

Functions

What publishing draft writes over the page it was made from: every field it carries but the page's code (MishkaCmsCore.Runtime.Authoring.CodeAccess.fields/0).

Functions

carried(draft)

@spec carried(struct()) :: map()

What publishing draft writes over the page it was made from: every field it carries but the page's code (MishkaCmsCore.Runtime.Authoring.CodeAccess.fields/0).

The editor publishes its working copy straight to the page, and asks MishkaCmsCore.Runtime.Authoring.Drafts.carried/2 for this, so both publishes write the same.