Skip to content

Update exit page controller to work with both new-style and old-style exit pages - #2287

Merged
lfdebrux merged 5 commits into
mainfrom
ldeb-new-style-exit-pages
Aug 17, 2026
Merged

Update exit page controller to work with both new-style and old-style exit pages#2287
lfdebrux merged 5 commits into
mainfrom
ldeb-new-style-exit-pages

Conversation

@lfdebrux

@lfdebrux lfdebrux commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

What problem does this pull request solve?

Trello card: https://trello.com/c/0ijhpyt8/3146-update-forms-runner-to-work-with-more-than-one-exit-page-for-a-question

This PR reapplies the changes from #2283, with additional commits to make the exit_page#show action work with old-style exit pages as well as new-style ones.

I've tested this in dev, with a form that has a form document with old-style exit pages, and a form document that has old-style exit pages.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Do the end to end tests need updating before these changes will pass?
  • Has all relevant documentation been updated?

Previously these methods were returning a blank string when these
attributes were unset in the form document, we want these methods to
return nil instead.
At some point in the future we may remove the exit page content
attributes from the condition objects in a form document, this commit
ensures that the #exit_page? method will continue working if/when that
happens.
We still have some form documents in production using old-style exit
pages (without the exit_page_id attribute in the condition), this commit
ensures that the Condition model still works with condition objects from
those form documents.
Add fallback code to handle form documents which use old-style exit
pages (where condition objects don't have an exit_page_id attribute and
step objects don't have an exit_pages array).

As part of this we allow the ExitPage model to have nil id, so it can
hold the exit page content from a condition and work in the existing
exit page view template.
@lfdebrux
lfdebrux force-pushed the ldeb-new-style-exit-pages branch from f2d9128 to 9241a29 Compare August 14, 2026 13:44
@github-actions

Copy link
Copy Markdown
Contributor

🎉 A review copy of this PR has been deployed! It is made of up two components

  1. A review copy of forms-runner
  2. A production copy of forms-admin

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

@lfdebrux
lfdebrux added this pull request to the merge queue Aug 17, 2026
Merged via the queue into main with commit 4204a04 Aug 17, 2026
3 checks passed
@lfdebrux
lfdebrux deleted the ldeb-new-style-exit-pages branch August 17, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants