From 3756477114898adec52a017638ef3060ae709486 Mon Sep 17 00:00:00 2001 From: Aaron Scully Date: Wed, 20 May 2026 20:17:15 +0100 Subject: [PATCH] Fixing bug whereby lack of draft version of a form prevents the privacy policy from working. --- src/server/plugins/router.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/server/plugins/router.ts b/src/server/plugins/router.ts index 357f7bd93..486e247ce 100644 --- a/src/server/plugins/router.ts +++ b/src/server/plugins/router.ts @@ -137,7 +137,11 @@ export default { async handler(request, h) { const { slug } = request.params const form = await getFormMetadata(slug) - const definition = await getFormDefinition(form.id, FormStatus.Draft) + // It's most likely that we come into this route from a live version of the form + // so prefer that and fallback to draft if no live version (it is possible to have + // a live version and no draft version, so we cannot just default to 'draft'). + const formStatus = form.live ? FormStatus.Live : FormStatus.Draft + const definition = await getFormDefinition(form.id, formStatus) return h.view('help/privacy-notice', { form,