Update exit page controller to work with both new-style and old-style exit pages - #2287
Merged
Conversation
This reverts commit dfbbcf1.
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
force-pushed
the
ldeb-new-style-exit-pages
branch
from
August 14, 2026 13:44
f2d9128 to
9241a29
Compare
Contributor
|
🎉 A review copy of this PR has been deployed! It is made of up two components It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready For the sign in details and more information, see the review apps wiki page. |
SamJamCul
approved these changes
Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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#showaction 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