diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-21 17:34:13 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-21 17:34:13 +0200 |
| commit | 65da515e27939c90a66ec3b063b5e58943d3dcea (patch) | |
| tree | 16ede71f65cc48444561dbde6c9c95368b564eb9 /vendor/plugins/globalize2/test/backends/static_test.rb | |
| parent | cc4659a308590be083065f19df8571efc345052a (diff) | |
pages_controller#preview loaded a page by id and rendered it
directly, assuming @page.node was always present. True for head and
draft, since both carry a real node_id: false for autosave, which
deliberately has node_id: nil (the mechanism that excludes it from
Node#pages and the revision count). A node with an autosave and no
draft underneath it: lock, start editing, never explicitly save a
draft: loads that autosave directly with no node at all, and any
view code assuming @page.node is real (headline image, credits,
gallery links) raises.
When @page has no node, resolve it by checking autosave_id, then
draft_id, then head_id on Node, and set @page.node in memory only:
the autosave's node_id: nil is never persisted differently. The
existing swap from draft to a fresher autosave, when both exist, is
unchanged.
Three tests: draft with a fresher autosave on top, autosave with no
draft underneath, and the ordinary head-only case with neither.
Diffstat (limited to 'vendor/plugins/globalize2/test/backends/static_test.rb')
0 files changed, 0 insertions, 0 deletions
