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 for csv preview with legacy_url_path #3781

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

syed-ali-tw
Copy link
Contributor

Reference issue:https://govuk.sentry.io/issues/4265154142/?alert_rule_id=3654813&alert_type=issue&notification_uuid=8ab09d48-0416-4305-9e3c-0de49561a46a&project=202225&referrer=slack

Currently content item when it returns attachments, it returns modern url hence when it tries to find for legacy url, it fails and @attachment_metadata is empty this cause @attachment_metadata.first to be nil and hence the error.

With the fix we try to not rely on legacy_url_path, instead we look for the filename.

@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-3781 September 29, 2023 12:08 Inactive
app/controllers/csv_preview_controller.rb Outdated Show resolved Hide resolved
@syed-ali-tw syed-ali-tw force-pushed the csv-preview-with-modern-url branch from 8b631c3 to 028bbe5 Compare September 29, 2023 12:23
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-3781 September 29, 2023 12:24 Inactive
Reference issue:https://govuk.sentry.io/issues/4265154142/?alert_rule_id=3654813&alert_type=issue&notification_uuid=8ab09d48-0416-4305-9e3c-0de49561a46a&project=202225&referrer=slack

Currently content item when it returns attachments, it returns modern url
hence when it tries to find  for legacy url, it fails and @attachment_metadata is empty
this cause @attachment_metadata.first to be nil and hence the error.

With the fix we try to not rely on legacy_url_path, instead we look for the filename.
@syed-ali-tw syed-ali-tw force-pushed the csv-preview-with-modern-url branch from 028bbe5 to 35c07f7 Compare September 29, 2023 12:27
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-3781 September 29, 2023 12:27 Inactive
@richardTowers richardTowers merged commit e45397c into main Sep 29, 2023
7 checks passed
@richardTowers richardTowers deleted the csv-preview-with-modern-url branch September 29, 2023 12:31
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