What it does
Everyone who edits a page works on a private copy of their unsaved changes. What you type doesn't appear on anyone else's screen, and your Save, Discard and Undo affect only your own copy. Without an import, two people's work on a page comes together when they save: the second save is merged with the first (see "Two people editing the same page" in the Page Editor Tour).
Draft import lets you combine work before anyone saves. While you have unsaved changes, your editor makes them available to the other people who open the same page in the editor, and any of them can import them: your changes are merged into theirs, and they carry on from there with their own Save, Discard and Undo. A typical case: you're helping someone edit their site, you want to carry on exactly where they left off, and later you hand the result back to them.
Your unsaved changes never appear on the live site, and they only appear in someone else's editor when that person imports them. Every editor's unsaved changes are offered this way; there is no setting to turn it on or off. A "draft" here means unsaved changes in the editor, not a page whose status is Draft.
Anyone who can edit pages can import a draft. Some changes can only be imported by an Admin — see "Who can import what" below.
How to use it
Seeing who else has unsaved changes
When someone else has unsaved changes on the page you have open, a notice above the list of sections says so, one entry per person with the most recent first. Each entry names the person ("Sam has unsaved changes on this page"), says when they last changed something ("Last edited just now", "Last edited 3m ago"), and has an Import button. When their changes can't be imported right now, the entry says why instead of showing the button (see "You both need to be on the same saved version" below).
The notice refreshes about every 30 seconds while the editor is the tab you're looking at, straight away when you come back to the tab, and right after you save or discard. It is hidden while your editor shows the orange "This page was changed outside your editing session" banner: choose Keep mine or Discard mine there first.
Drafts belong to the file you have open. In the header or footer of a page (see In-Place Header & Footer Editing), the notice lists other people's unsaved changes to that header or footer.
Importing their changes
- Click Import on their entry, then Import again in the "Import unsaved changes from Sam?" window.
- Their changes are merged into yours. Changes that don't overlap combine automatically: sections they added, removed, moved or edited, and the text, images and styling they changed, join your own unsaved edits.
- Check the result in the preview. The editor confirms with "Imported Sam's unsaved changes. Nothing is saved until you save the page." Your page stays unsaved until you click Save.
The whole import is one step in your undo history: Undo (Ctrl+Z, or Cmd+Z on a Mac) takes all of it back at once, and Redo puts it back. Importing the same draft again brings nothing new and duplicates nothing; the editor says "You already have all of Sam's changes."
An import and a save never run at the same time. Clicking Save while an import is running shows "Wait for the import to finish, then save.", and importing while a save is running shows "Wait for the save to finish, then import."
When you both changed the same thing
If you both changed the same field, the same item in a section, or a section one of you removed while the other edited it, a list of those items opens before anything is merged, headed "You and Sam changed the same things". For each item, choose Keep my version or Use their version — for a section one of you removed, the choices read Keep the section removed or Remove the section — or use Use mine for all / Use theirs for all. Then click Apply and import.
Don't import closes the list and leaves your page exactly as it was.
Handing the work back
To hand the combined work back, the other person imports from your entry in the same way. A few seconds after your import, your unsaved changes — including everything you imported — are available to them. Their own changes that you left alone come back to them without any questions; anything of theirs that you changed afterwards is offered to them in the list of items you both changed.
What comes across
- Content — text, images, links, buttons, and every other field you type into or pick.
- Styling — classes, colors and spacing, and section design (background, color preset, dividers, animation and the rest of the section's design panel).
- Structure — sections added, removed, moved, renamed, hidden or swapped for another design, and items added, removed or moved inside a section — including layout changes to a shared section (see "Shared sections").
- The page's code (Edit page code) — when the person importing is an Admin; see "Who can import what".
What doesn't come across:
- A pending "Make shared". A section the other person marked to become a shared row when they save (it shows Shared on save) arrives as an ordinary section with its content. Mark it again if you want it shared.
- Their undo history. Each person keeps their own. For you, the import is one step.
- Their last few seconds of editing before they closed the tab — see "When changes become available".
Rules and limits
You both need to be on the same saved version
An import never merges changes made against different saved versions of the page. If the page has been saved since one of you opened it, the entry shows no Import button and says who has to catch up:
- "This page was saved since you opened it. Reload the page to import their changes." — your editor is on an older version of the page and you have nothing unsaved.
- "This page was saved since you opened it. Save your changes to catch up — reloading could lose them." — the same, but you have unsaved changes of your own.
- "Sam's draft started from an older version of this page, so it can't be imported. Ask them to save their changes." — their changes started from an older version.
Reloading is the right step for whoever has nothing unsaved. If you have unsaved changes of your own, save rather than reload: after someone else has saved, a reload can't bring back unsaved text and styling edits (see Draft Recovery), whereas a save is merged with the newer version as usual, and anything you both changed is offered in a list like the one above. In short: once the page has been saved, combine work by saving, not by importing.
Who can import what
Only an Admin (or above) can edit a page's code or add PHP and Livewire items, and an import checks both people's roles so it can't hand those to anyone else:
- If their draft changes the page's code, or adds code that only an Admin may add (such as a PHP or Livewire item) to a section, only an Admin can import it.
- Anything typed into a PHP or Livewire item can be imported only when both of you are Admins.
- If any part of the draft falls foul of these rules, the whole import is refused, and the message names the section (or the page's code) that stopped it. Nothing is ever partly imported.
Some everyday changes also touch the page's code behind the scenes (adding or removing certain sections does), so someone who isn't an Admin can be refused even when neither of you is an Admin. The message then reads "Sam's draft changes this page's code, which only an Admin can import. Ask Sam to save the page instead." Once they have saved, their changes reach you the next time you save (your save is merged with theirs), or when you reload if you have nothing unsaved.
Shared sections
A shared section can be edited for every page that uses it, or customized for this page only (see Shared Rows). An import keeps each change at the level its author made it:
- If they customized a shared section for this page only and you haven't changed that section, the import switches your copy of it to "this page only" too, so their changes stay on this page. The section is then marked as customized for this page only (an amber icon and a Page only label), and it stays that way even if you undo the import.
- If one of you edited a shared section for every page while the other customized it for this page only, the import is refused until you both edit it the same way.
A shared section's layout (its items added, removed, moved or hidden — see Shared Rows) comes across too, and your next save writes it for every page that uses the section:
- If only they changed it, you get their layout — as long as the section hasn't been saved since they started. If it has, the import is refused and says who needs to catch up.
- If you both changed it, the two are combined when you changed different items; when you changed the same item, you choose which version to keep.
- A layout change can't land on a section you have customized for this page only, or on one whose layout can't be changed in your editor (a header / footer or popup, for example) — the import is refused.
Changes that can't be combined
Some changes can't be combined automatically — for example, when you both changed the page's code. The import is then refused ("Your changes and Sam's can't be combined automatically — for example, you both changed the page code. Save or discard your changes first, then import."). To take their version, discard your own unsaved changes, then import.
When changes become available
- Your editor makes your unsaved changes available a few seconds after you stop editing, and every 15 seconds or so while you keep going. Edits from the last few seconds before you close the tab may not make it.
- When you save or discard, your draft is withdrawn straight away. It drops off other people's notice the next time their notice refreshes.
- A draft that hasn't changed for two days is cleared away.
- If you have the same page open in a second tab or another browser, other people see the draft from whichever of your tabs changed something most recently; the two tabs' changes are not combined. Opening the page again elsewhere can hide your unsaved changes from others for a short while, and your first tab offers them again within about 30 seconds once you're back in it.
If your editing session expires
An editor left open for a long time can lose its editing session on the server. When that happens, the notice disappears, nothing more of yours is passed on to others, and saving — like preview updates and undo — is refused with "This editing session has expired. Reload the page to continue." every time, until you reload. After the reload, your unsaved text and styling edits come back as usual (see Draft Recovery); unsaved changes to the page's structure — sections or items added, removed or moved — don't.
Saving after an import
Saving works exactly as it always does. If both of you save after an import, the second save is merged with the first, and you're asked to choose only where you both changed the same thing. Importing never changes the other person's copy: they keep their own unsaved changes until they save or discard them.
Sites on several servers
Drafts are kept on the server where the editing happens. On a site that runs on several servers, two people see each other's drafts only when their editors run on the same server — the same single-server rule the editor already has in that setup (see the multi-server guide).
Messages you might see
| Message | What it means |
|---|---|
| "That draft is no longer available. It may have been saved or discarded." | They saved or discarded since your notice last refreshed, or their draft is otherwise gone. The message stays on screen until you dismiss it. If they saved, their changes are now on the page: see "You both need to be on the same saved version". |
| "This page was saved since you opened it. Reload the page to import their changes." / "This page was saved since you opened it. Save your changes to catch up — reloading could lose them." / "Sam's draft started from an older version of this page, so it can't be imported. Ask them to save their changes." | The two of you are on different saved versions — see "You both need to be on the same saved version". |
| "This page changed while your unsaved changes were open. Keep or discard them before importing someone else's." | Your editor shows the orange page-changed banner. Choose Keep mine or Discard mine first. |
| "Your changes and Sam's can't be combined automatically — for example, you both changed the page code. Save or discard your changes first, then import." | See "Changes that can't be combined". |
| "Sam's draft changes this page's code, which only an Admin can import. Ask Sam to save the page instead." | See "Who can import what". |
| "Sam's draft adds code to the section "Hero" that only an Admin can import." | Their draft adds something to that section that only an Admin may add. An Admin can import it, or Sam can save the page so you pick the change up from there. |
| "Sam's draft changes a PHP or Livewire block in "Hero". Only an Admin can import that, and only from another Admin." | Changes inside PHP and Livewire items move by import only between two Admins. |
| "Sam customized the shared section "Footer CTA" for this page only, but your changes to it apply to every page. Import isn't possible until you both edit it the same way." (or the reverse) | See "Shared sections". |
| "The shared section "Footer CTA" was saved since you changed its layout. Save your changes to catch up, then import." / "The shared section "Footer CTA" changed since Sam edited its layout, so their draft can't be imported. Ask them to save their changes." | That section's layout was saved since one of you changed it — see "Shared sections". |
| "Sam's draft changes the layout of the shared section "Footer CTA", which can't be changed here." | Its layout can't change in your editor — for example you customized it for this page only. |
| "Both drafts change the same part of this shared section's layout. It appears on other pages too." | In the list of things you both changed: pick whose layout to keep. |
| "This editing session has expired. Reload the page to continue." | See "If your editing session expires". |
| "That change could not be saved — a section contained unexpected code. Reload the page and try again." | One of your own unsaved changes was refused before anything was imported. Reload the page and try again. |
| "The import didn't go through. Check your connection and try again." | The request failed; nothing was imported. |
| "The import finished, but the editor didn't update to show it. Reload the page, then import again." | Rare. Reload the page, then import again. |
How it fits with other features
- Draft Recovery brings back your own unsaved changes after a refresh, a closed tab or a crash, in the same browser. Draft import copies someone else's unsaved changes into your editor. Once imported, they are part of your own unsaved work and are recovered like any other edit.
- Saving at the same time — when two people save the same page, the second save is merged with the first. See "Two people editing the same page" in the Page Editor Tour.
- Backups & Page Revisions — an import saves nothing. The save that follows it snapshots a page revision like any other save.
Where this lives in the code
- The shared draft store —
EditorSharedDraft: three files per (page file, user) understorage/framework/editor-shared-drafts/(configcms.editor_shared_draft_path) — a small meta file, the structural half (rows, page code, the save-time delete queues, the shared-row page-only map, unsaved shared-row layouts) and the owner's unsaved field values. Removed when the session goes clean; ignored and pruned after 48 hours. - Publish + list —
EditorDraftShareActions:syncSharedDraftAfterRequest()(called from the editor'sdehydrate()),publishSharedDraftValues()andlistSharedDrafts(). - Import —
EditorDraftImportActions(importSharedDraft()), on the three-way merge engineEditorSaveMerger(mergeRows,mergePhpSection,mergeStagedValues, anddescribeConflicts(…, forImport: true)for the chooser wording). - Client —
otherDrafts,importDraft(), the publish push and the notice poll inresources/js/editor/editor-state.js; the confirm component (editorDraftImportConfirm), the chooser's import mode (editorMergeConflicts) and the navigation / tab-visibility hooks inresources/js/manager.js. - UI — the notice (
data-draft-import-notice) in⚡editor.blade.php, the confirm window ineditor-draft-import-modal.blade.php, and the chooser ineditor-merge-conflict-modal.blade.php. - Tests —
EditorSharedDraftStoreTest(store, publish, list),EditorDraftImportTest(the import),EditorDraftImportStoreTest(the browser side). - Developer detail: "Draft import" in editor-architecture.md.