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

Update taxon icon to use present instead of exists #3869

Merged
merged 1 commit into from Jan 7, 2021

Conversation

seand7565
Copy link
Contributor

@seand7565 seand7565 commented Dec 18, 2020

exists? on a paperclip object attempts to access the image where
it's stored, whereas present? just checks if the object exists on
Solidus.

Using exists? here causes an error if the image doesn't exist. Luckily,
paperclip double checks that the image filename is present before
attempting to fetch it from the storage service, but paperclip_cloudinary
does not do this, meaning that any store using paperclip_cloudinary is
unable to view the admin taxon edit page for taxons without icons.

This was an issue on the demo store, which uses paperclip_cloudinary. I've patched it up there, but figured I should add a fix here as well.

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)
  • I have attached screenshots to this PR for visual changes (if needed)

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Thanks Sean!

Copy link
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

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

@seand7565 thanks 👍

`Exists` on a paperclip object attempts to access the image where
it's stored, whereas present just checks if the object exists on
Solidus.

Using exists here causes an error if the image doesn't exist. Luckily,
paperclip double checks that the image filename is present before
attempting to fetch it from the storage service, but paperclip_cloudinary
does not do this, meaning that any store using paperclip_cloudinary is
unable to view the admin taxon edit page for taxons without icons.
@kennyadsl kennyadsl merged commit 01d99a8 into solidusio:master Jan 7, 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.

None yet

5 participants