From 6e19cd795db4779088275bc2965455917f8d29e9 Mon Sep 17 00:00:00 2001 From: Sean Date: Fri, 18 Dec 2020 14:34:35 -0600 Subject: [PATCH] Update taxon icon to use present instead of exists `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. --- .../spree/admin/taxons/attachment_forms/_paperclip.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/views/spree/admin/taxons/attachment_forms/_paperclip.html.erb b/backend/app/views/spree/admin/taxons/attachment_forms/_paperclip.html.erb index e6e3cad14e1..f6e2d899add 100644 --- a/backend/app/views/spree/admin/taxons/attachment_forms/_paperclip.html.erb +++ b/backend/app/views/spree/admin/taxons/attachment_forms/_paperclip.html.erb @@ -2,7 +2,7 @@ <%= f.field_container attachment do %> <%= f.label attachment %>
<%= f.file_field attachment %> - <% if f.object.send(attachment).exists? %> + <% if f.object.send(attachment).present? %> <%= image_tag f.object.send(attachment, definition[:default_style]) %> <%= link_to t('spree.actions.remove'), admin_taxonomy_taxon_attachment_path(@taxonomy,