The Timeout node-feature form infers the deadline mode from which field is filled: entering an "Until (date variable)" silently overrides the duration and "Measured from", and both modes' fields show at once. It is hard to tell which fields apply.
Make the relative-vs-absolute choice explicit and the form self-explanatory:
- A "Deadline" selector with two modes: "After a duration" (relative) and "Until a date" (absolute). It defaults to "After a duration" when no value is set.
- Only the selected mode's fields show (relative: duration + "Measured from"; absolute: the date or variable + offset), via #states.
- Validation and save are gated on the selected mode: saving writes only that mode's keys and clears the other mode's leftover values, so the stored config represents exactly one mode. The #states hiding is cosmetic; the save is authoritative.
- The selector is UI only: no stored mode key and no schema change. The single source of truth stays "which field is set", and the runtime reads that.
Each value field accepts a literal or a process variable, resolved at runtime: a value that parses as a duration is literal, otherwise it is a variable holding a duration; the date field symmetrically accepts a literal date or a variable. This subsumes a "duration from a variable" case without adding a fourth mode entry. parkDeadline() gains the literal-or-variable resolution.
Default when empty is relative ("After a duration"), preserving today's empty-duration behavior (the site default, or no timeout when there is no site default).
Issue fork orchestra-3605939
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mably commentedComment #5
mably commented