fromthepage
fromthepage copied to clipboard
Metadata description problems for not-logged-in users
If a user is not logged in, the following problems occur for metadata projects:
Error from the log file:
I, [2022-09-09T07:26:45.181469 #32087] INFO -- : Rendered work/describe.html.slim within layouts/application (Duration:
113.9ms | Allocations: 58402)
I, [2022-09-09T07:26:45.182787 #32087] INFO -- : Completed 500 in 136ms (ActiveRecord: 37.5ms | Allocations: 68001)
F, [2022-09-09T07:26:45.193319 #32087] FATAL -- :
ActionView::Template::Error (undefined method `+' for nil:NilClass):
36: =svg_symbol '#icon-arrow-left', class: 'icon', title: 'Previous page'
37:
38: span.page-nav_info = t('.metadata')
39: -next_works = @collection.works.to_a[index+1..]
40: -next_work = next_works.detect {|candidate| candidate.pages.where(status: [nil, Page::STATUS_INCOMPLETE]).first || candidate.description_status == Work::DescriptionStatus::UNDESCRIBED }
41: -if next_work
42: -next_page = next_work.pages.where(status: [nil, Page::STATUS_INCOMPLETE]).first
@benwbrum This issue is related to this and is fixed.
Fixed and deployed.