-
Notifications
You must be signed in to change notification settings - Fork 4
Description
This affects the ability to select one or more works from the Dashboard-->My-->Works (or All-->Works) view and add them to a collection. The functionality works for the first page of results. It breaks on subsequent pages.
After debugging the Hyrax code, I believe this has to do with an incorrect Solr parameter that is passed to the search builder on subsequent pages, when querying for collections to which a user has access. The Solr response looks like this:
App 15493 output: E, [2025-05-13T17:08:51.172301 #15493] ERROR -- : Search response {"responseHeader"=>{"status"=>0, "QTime"=>0, "params"=>{"facet.field"=>["visibility_ssi", "suppressed_bsi", "resource_type_sim", "admin_set_sim", "member_of_collections_ssim"], "qt"=>"search", "start"=>"100", "fq"=>["{!terms f=id}p5547r367,0v8380566", "{!terms f=has_model_ssim}Collection", "-suppressed_bsi:true"], "f.resource_type_sim.facet.limit"=>"6", "sort"=>"title_si asc", "rows"=>"100", "f.admin_set_sim.facet.limit"=>"6", "f.member_of_collections_ssim.facet.limit"=>"6", "f.visibility_ssi.facet.limit"=>"6", "qf"=>"title_tesim description_tesim creator_tesim keyword_tesim", "wt"=>"json", "facet"=>"true"}}, "response"=>{"numFound"=>2, "start"=>100, "maxScore"=>1.0, "docs"=>[]}, "facet_counts"=>{"facet_queries"=>{}, "facet_fields"=>{"visibility_ssi"=>["open", 2], "suppressed_bsi"=>[], "resource_type_sim"=>[], "admin_set_sim"=>[], "member_of_collections_ssim"=>[]}, "facet_ranges"=>{}, "facet_intervals"=>{}, "facet_heatmaps"=>{}}}
Note that "numFound"=>2, which is correct in this case (there being two collections available), but that the start parameter is set to 100, which results in no documents being returned.
I subsequently discovered that this is (was) apparently a bug in Hyrax 3.x; the imputation seems to be that it has been fixed at least as of version 5.
Not sure whether it's worth the effort to try to fix it; it would only affect situations where we needed to add 100+ works to a collection at once, which doesn't come up that often. I think a higher priority is being able to add works to a collection via Bulkrax.