Repository navigation
Keep the entry form's base version, stop rewriting untouched values, and say which draft the form shows #2630
Copy link
Copy link
Closed
Labels
Milestone
Description
Part of #2426 (F-FRM). Follow-up to #2613: findings from an independent review of the merged generated forms. The save path's unit of work and its choice between update and create held up.
Findings
- High: a stale form gets past the version check after any refused save. The hidden
BaseVersionis rendered from the entry reloaded on every post. The person's old values are re-shown under the new base version.- A opens version 1, and B saves version 2.
- A submits with bad JSON. The page comes back with base 2.
- A's corrected submit stores version 3, and B's change is lost. This was reproduced against v2.
- Medium: an edit rewrites values the person did not touch.
- The
datetime-localwidget drops seconds and fractions, and turns offsets intoZ. A stored09:30:45Zsaves back as09:30:00Z. - Browsers send textarea line breaks as CRLF, so LF text comes back as CRLF.
- A title-only edit then shows other fields as changed, and the seconds are lost for good.
- The
- Medium: rejected or reverted content is pre-filled as the entry's current values. The form starts from the latest version. After a rejection or a revert, that version is the rejected or reverted content, and nothing tells the person.
- Medium: Acceptance not fully tested.
- No test that editing a published entry gives an update based on the published version.
- No test of submitting the saved set and the checks running.
- The unknown enum value is never asserted.
- No keyboard test of the form.
- The axe check covers only a single text field, with no other widgets and no error state.
- Low:
EntryEditsfinds a blank rationale only after writing the version. That breaks the "expected failures before the unit of work" rule. It is still correct, because the write rolls back.
Scope
- The hidden
BaseVersioncomes from the form being shown, as in Keep the media details form's base version and stop refused uploads filtering the library #2629. - A posted value that shows the same as the stored one keeps the stored JSON, so untouched dates, numbers and texts are not rewritten. Text and rich text line breaks are normalized to LF.
- When the latest draft is not the published version and no set is reviewing it, the form says which version it shows. It offers to start from the published version instead (
?from=published), and the update is still based on the latest version, so the version check holds. EntryEditschecks the rationale and sources before it writes.- Tests:
- The stale-form scenario above ends in a conflict.
- An edit that changes only the title proposes a diff with only the title.
- Editing a published entry gives an update from the published version.
- Saving, submitting and the checks running end to end.
- The unknown enum value is reported.
- A keyboard browser test fills and saves the form.
- The axe check covers a form with every widget and a refused submit.
Acceptance
- The overwrite scenario ends in a conflict message, and B's change stays.
- A title-only edit of an entry with a date-time and multi-line text changes only the title.
- After a revert, the form says it shows the reverted draft and offers the published version.
Activity