Prevent associating a standard edition with itself [WHIT-3124]#11218
Open
patrickpatrickpatrick wants to merge 2 commits intomainfrom
Open
Prevent associating a standard edition with itself [WHIT-3124]#11218patrickpatrickpatrick wants to merge 2 commits intomainfrom
patrickpatrickpatrick wants to merge 2 commits intomainfrom
Conversation
ryanb-gds
reviewed
Mar 9, 2026
Contributor
ryanb-gds
left a comment
There was a problem hiding this comment.
This is quite a clever solution, but I don't know if the assumption that the container name would be equal to the configurable document type will necessarily hold. Or the assumption that the value will match the document ID.
Having said that, I don't have a better idea of how to solve this. I'd feel safer doing it on the validation side, where we have fuller context (i.e. we validate in the Edition::TopicalEvents concern that the edition isn't referencing itself). Probably one to discuss with the team. I appreciate we don't want to spend too much time on this though as it is an edge case
1f3f0a2 to
b734c82
Compare
In the `select_with_search_tagging` helper, remove the option to associate an edition with itself if the container name matches the configurable document type of the edition.
In addition to the frontend interface hiding the option to associate a topical event with itself, add extra validation to the Topical Event concern to ensure that the user can't somehow get around this for safety.
b734c82 to
9479405
Compare
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
Why
Prevent association of an edition with itself, which might result in a publishing workflow loop.
This application is owned by the Whitehall Experience team. Please let us know in #govuk-whitehall-experience-tech when you raise any PRs.
Follow these steps if you are doing a Rails upgrade.