Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix variable scope of context boolean #2292

Merged
merged 1 commit into from
Nov 18, 2021
Merged

Fix variable scope of context boolean #2292

merged 1 commit into from
Nov 18, 2021

Conversation

maxgds
Copy link
Contributor

@maxgds maxgds commented Nov 18, 2021

In #2238 we added the word overview to format titles where an attachment shared the name of the page. The intent was for this to appear inside the H1, using the context_inside parameter. Unfortunately a refactor after review meant that the variable was scoped too tightly and never available to the component call. This resolves that by initially setting the variable outside of the each loop, and adds extra testing to ensure it is there when necessary.

Sample affected url: https://www.gov.uk/government/consultations/call-for-evidence-to-inform-orbital-liability-and-insurance-policy

Before:

image

After:

image

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

@govuk-ci govuk-ci temporarily deployed to government-f-fix-contex-e4kaye November 18, 2021 08:34 Inactive
@maxgds maxgds requested a review from jon-kirwan November 18, 2021 08:41
Copy link
Contributor

@jon-kirwan jon-kirwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, works fine for me. Double checked against the original list of sample addresses in #2238 and all ok there too. 👍

@maxgds maxgds merged commit dd3fc77 into main Nov 18, 2021
@maxgds maxgds deleted the fix-context-scope branch November 18, 2021 12:44
maxgds added a commit that referenced this pull request Dec 8, 2021
maxgds added a commit that referenced this pull request Dec 8, 2021
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.

3 participants