From d20237e1f540d5dba711fc813a3a1744a4611d61 Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 16 Feb 2022 09:29:25 +0000 Subject: [PATCH] Route to the next page if the first one is not routed to from tasklist --- app/helpers/tasklist_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/helpers/tasklist_helper.rb b/app/helpers/tasklist_helper.rb index 148f2f1e7..3b3afaa4e 100644 --- a/app/helpers/tasklist_helper.rb +++ b/app/helpers/tasklist_helper.rb @@ -29,7 +29,8 @@ module TasklistHelper path = if subsection.is_started?(case_log) "case_log_#{subsection.id}_check_answers_path" else - "case_log_#{subsection.pages.first.id}_path" + next_page = subsection.pages.first.routed_to?(case_log) ? subsection.pages.first.id : case_log.form.next_page(subsection.pages.first, case_log) + "case_log_#{next_page}_path" end send(path, case_log) end