Conversation
`declaration_text` is deprecated and not set by any of the pages in forms-admin. It would be good to remove it altogether. Update specs that use `declaration_text` to use the replacement, `declaration_markdown`, instead.
The `declaration_text` attribute on the forms model has been replaced with the `declaration_markdown` attribute and deprecated. It is no longer read in forms-runner or read or updated in forms-admin. Removing the attribute completely will simplify the form model and reduce the possibility of confusion. Removing the attribute from the forms model will not change existing form documents, but will stop if from being present in new form documents. This change will prevent `declaration_text` being copied from a form document to a form model when copying a form form or reverting a draft form, but there are no form documents in the production database which have declaration_text but not declaration_markdown that could cause issues [^1]. This commit tells the form model to ignore the `declaration_text` column, so that it can be safely removed in a future migration. --- [^1]: This was verified with the following SQL query: ``` gds aws forms-prod-support -- forms data_api -d forms-admin -s $'SELECT form_id, tag, version, language, content->\'declaration_text\' AS declaration_text, content->\'declaration_markdown\' AS declaration_markdown FROM form_documents WHERE content @@ \'($.declaration_text != null && $.declaration_text != "") && ($.declaration_markdown == null || $.declaration_markdown == "")\';' ``` Prior to govuk-forms/forms-runner#2334, the only situation when the `declaration_text` attribute was read was when `declaration_markdown` was blank. There are two forms in the production database where `declaration_markdown` is blank and `declaration_text` is present, however, these were reported as bugs by a form creator, as they had wanted to remove the form declaration.
declaration_text from formsdeclaration_text from forms (part 1)
declaration_text from forms (part 1)declaration_text from forms (part 1/2)
|
🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-3107.admin.review.forms.service.gov.uk/ 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. |
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?
The
declaration_textattribute on the forms model has been replaced with thedeclaration_markdownattribute and deprecated. It is no longer read in forms-runner or read or updated in forms-admin.Removing the deprecated attribute completely will simplify the form model and reduce the possibility of confusion.
Removing the attribute from the forms model will not remove it from the form document model or change existing form document contents, but will stop if from being present in new form documents.
This change will prevent
declaration_textbeing copied from a form document to a form model when copying a form form or reverting a draft form, but there are no form documents in the production database which have declaration_text but not declaration_markdown that could cause issues 1.This PR tells the form model to ignore the
declaration_textcolumn, so that it can be safely removed in PR #3108.Things to consider when reviewing
Footnotes
This was verified with the following SQL query:
Prior to https://github.com/govuk-forms/forms-runner/pull/2334, the only situation when the
declaration_textattribute was read was whendeclaration_markdownwas blank.There are two forms in the production database where
declaration_markdownis blank anddeclaration_textis present, however, these were reported as bugs by a form creator, as they had wanted to remove the form declaration. ↩