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 missing icon error in production environment #12150

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

alecslupu
Copy link
Contributor

@alecslupu alecslupu commented Dec 11, 2023

🎩 What? Why?

When running in production, if there is a reference to a missing icon, then the page will render a 500.

The error looks like:

[7724a1cc-2e06-42bc-8dfb-abd7087e4b27] ActionView::Template::Error (undefined method `[]' for nil:NilClass

 name = Decidim.icons.find(name)["icon"] unless options[:ignore_missing]
                                ^^^^^^^^):

📌 Related Issues

Link your PR to an issue

Testing

  1. Write a reference to an icon in a page / footer like: icon('some-missing-icon-that-went-foo-bar')
  2. Start the application in prod environment
  3. Access the page and see the 500 error
  4. Apply patch
  5. Restart app
  6. See the image got replaced by "question-line"

♥️ Thank you!

@alecslupu alecslupu added the type: fix PRs that implement a fix for a bug label Dec 11, 2023
@alecslupu alecslupu marked this pull request as ready for review December 11, 2023 18:59
Copy link
Member

@fblupi fblupi left a comment

Choose a reason for hiding this comment

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

Tested locally and works 👍

@andreslucena andreslucena changed the title Fix missing icon error Fix missing icon error in production environment Dec 12, 2023
@andreslucena andreslucena merged commit d1c7ab4 into develop Dec 12, 2023
112 of 113 checks passed
@andreslucena andreslucena deleted the fix/icons-missing branch December 12, 2023 12:41
@alecslupu alecslupu added release: v0.28 Issues or PRs that need to be tackled for v0.28 no-backport Pull Requests that should not be backported labels Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-backport Pull Requests that should not be backported release: v0.28 Issues or PRs that need to be tackled for v0.28 type: fix PRs that implement a fix for a bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants