Skip to content

Finding aids with nested collections index 'successfully', but then cause page crashes #1533

@mxMiles

Description

@mxMiles

It is possible to index an ead that has nested collections. This causes page crashes.
See collectionInCollection.txt example file.

Expected behavior

I expect either the page to load or the file to not index.

Actual behavior

The indexer will index this file without error. If you navigate to the finding aid or it shows up in search results, the page will not load. The log file says:

I, [2024-05-08T09:51:40.077867 #1584162]  INFO -- : [f9ad2102-0c5f-4ac5-85b5-465bbc29519b] Started GET "/caoSearch/catalog?f%5Blevel%5D%5B%5D=Collection&f%5Brepository%5D%5B%5D=Unicorn+Test+Repository%3A+where+weird+data+comes+to+life%21" for 10.135.171.48 at 2024-05-08 09:51:40 -0400
I, [2024-05-08T09:51:40.078836 #1584162]  INFO -- : [f9ad2102-0c5f-4ac5-85b5-465bbc29519b] Processing by CatalogController#index as HTML
I, [2024-05-08T09:51:40.078904 #1584162]  INFO -- : [f9ad2102-0c5f-4ac5-85b5-465bbc29519b]   Parameters: {"f"=>{"level"=>["Collection"], "repository"=>["Unicorn Test Repository: where weird data comes to life!"]}}
I, [2024-05-08T09:51:40.209573 #1584162]  INFO -- : [f9ad2102-0c5f-4ac5-85b5-465bbc29519b]   Rendered vendor/bundle/ruby/3.1.0/bundler/gems/arclight-8852569afb4c/app/views/catalog/index.html.erb within layouts/blacklight (Duration: 64.5ms | Allocations: 48783)
I, [2024-05-08T09:51:40.209702 #1584162]  INFO -- : [f9ad2102-0c5f-4ac5-85b5-465bbc29519b]   Rendered layout vendor/bundle/ruby/3.1.0/gems/blacklight-8.1.0/app/views/layouts/blacklight.html.erb (Duration: 64.7ms | Allocations: 48812)
I, [2024-05-08T09:51:40.209902 #1584162]  INFO -- : [f9ad2102-0c5f-4ac5-85b5-465bbc29519b] Completed 500 Internal Server Error in 131ms (ActiveRecord: 1.5ms | Allocations: 90449)
F, [2024-05-08T09:51:40.212721 #1584162] FATAL -- : [f9ad2102-0c5f-4ac5-85b5-465bbc29519b]   
[f9ad2102-0c5f-4ac5-85b5-465bbc29519b] ActionView::Template::Error (id must be present for all documents and components):
[f9ad2102-0c5f-4ac5-85b5-465bbc29519b]     4: <% view_config = local_assigns[:view_config] || blacklight_config&.view_config(document_index_view_type) %>
[f9ad2102-0c5f-4ac5-85b5-465bbc29519b]     5: <div <%= 'id="documents"'.html_safe unless grouped? %> class="al-document-listings documents-<%= view_config&.key || document_index_view_type %>">
[f9ad2102-0c5f-4ac5-85b5-465bbc29519b]     6:   <% document_presenters = documents.map { |doc| document_presenter(doc) } -%>
[f9ad2102-0c5f-4ac5-85b5-465bbc29519b]     7:   <%= render view_config.document_component.with_collection(document_presenters, partials: view_config.partials, counter_offset: @response&.start || 0) %>
[f9ad2102-0c5f-4ac5-85b5-465bbc29519b]     8: </div>
[f9ad2102-0c5f-4ac5-85b5-465bbc29519b]   
[f9ad2102-0c5f-4ac5-85b5-465bbc29519b] arclight (8852569afb4c) lib/arclight/normalized_id.rb:23:in `normalize'
[f9ad2102-0c5f-4ac5-85b5-465bbc29519b] arclight (8852569afb4c) lib/arclight/normalized_id.rb:15:in `to_s'
[f9ad2102-0c5f-4ac5-85b5-465bbc29519b] arclight (8852569afb4c) app/models/arclight/parents.rb:19:in `eadid'
[f9ad2102-0c5f-4ac5-85b5-465bbc29519b] arclight (8852569afb4c) app/models/arclight/parents.rb:25:in `block in as_parents'
[f9ad2102-0c5f-4ac5-85b5-465bbc29519b] arclight (8852569afb4c) app/models/arclight/parents.rb:25:in `map'

Steps to reproduce

  1. Index attached file.
  2. Navigate to the repository page for that finding aid, or search for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions