mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
Show order and admin page despite broken image
Avoiding:
ActiveStorage::InvariableError
Affects the admin order page and the customer's order confirmation page.
This commit is contained in:
@@ -1,6 +1 @@
|
||||
- if variant.product.images.length == 0
|
||||
= image_tag("/noimage/mini.png")
|
||||
- else
|
||||
- # A Rails bug makes it necessary to call `main_app.url_for` here.
|
||||
- # https://github.com/rails/rails/issues/31325
|
||||
= image_tag(main_app.url_for(variant.product.images.first.variant(:mini)))
|
||||
= image_tag(variant.product.images.first&.url(:mini) || "/noimage/mini.png")
|
||||
|
||||
@@ -43,8 +43,6 @@ describe "spree/orders/show.html.haml" do
|
||||
end
|
||||
|
||||
it "handles broken images" do
|
||||
pending "https://github.com/openfoodfoundation/openfoodnetwork/issues/9279"
|
||||
|
||||
image, = order.line_items.first.variant.product.images << Spree::Image.new(
|
||||
attachment: fixture_file_upload("logo.png", "image/png")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user