Closed ebarry closed 3 years ago
A staff member reports that:
I'm getting an error message when trying to load certain tag pages again (similar to an issue from August).
Affected pages:
I /think/ the error is this:
[e0fbe334-265a-4f2f-b73e-9cae3e3174ab] Completed 500 Internal Server Error in 439ms
(ActiveRecord: 212.9ms)
[e0fbe334-265a-4f2f-b73e-9cae3e3174ab]
[e0fbe334-265a-4f2f-b73e-9cae3e3174ab] ActionView::Template::Error (undefined method `photo_file_name' for #<DrupalFile:0x00007f60c1536f50>):
[e0fbe334-265a-4f2f-b73e-9cae3e3174ab] 1: <div class="card">
[e0fbe334-265a-4f2f-b73e-9cae3e3174ab] 2: <% if node.main_image %>
[e0fbe334-265a-4f2f-b73e-9cae3e3174ab] 3: <% img_path = node.main_image.path(node.main_image.photo_file_name == "blob" ? :original : :default) # special case for "blob" images, see https://github.com/publiclab/plots2/issues/10210 %>
[e0fbe334-265a-4f2f-b73e-9cae3e3174ab] 4: <a class="card-img-top img" style="overflow: hidden; height:10em;"<% if @widget %>target="_blank"<% end %> href="<%= node.path %>"><%= image_tag(img_path, style:'width:100%;', lazy: node.main_image.photo_file_name =! "blob") %></a>
[e0fbe334-265a-4f2f-b73e-9cae3e3174ab] 5: <% elsif node.scraped_image %>
[e0fbe334-265a-4f2f-b73e-9cae3e3174ab] 6: <a class="card-img-top img" style="overflow: hidden; height:10em;" href="<%= node.path %>"><%= image_tag(node.scraped_image, style:'width:100%;') %></a>
So we need to use a different method than photo_file_name
when screening for 'blob'. Should be a quick fix!
Attempted quick fix in https://github.com/publiclab/plots2/commit/c6c022ebda0a49a2c7f503aa19e7f6559562d49c
monitoring at https://stable.publiclab.org/tag/stormwater before publishing
I believe it's fixed and will publish these changes in about 1 hour.
Confirmed this is fixed!
Thank you!
Please describe the problem
I typed
spectralworkbench
into our Search Bar. i chose the first autosuggested result because i was looking for the tag page, and was surprised to see this error page:I expected to see a tag page with content tagged
spectralworkbench
Please show us where to look
https://publiclab.org/tag/spectralworkbench
What's your PublicLab.org username?
liz