samvera / hyrax

Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
http://hyrax.samvera.org/
Apache License 2.0
182 stars 122 forks source link

Show pages' items list includes the filesets of child works #6767

Open laritakr opened 3 months ago

laritakr commented 3 months ago

Descriptive summary

This behavior was noted on the double_combo branch. It may or may not exist prior.

When you call member_ids on a valkyrie object's solr_document, you get the direct fileset ids, as well as the ids of child works and their filesets. This is a change from ActiveFedora behavior, and seems to not be expected behavior.

In other words: valkyrie_object.member_ids = [valkyrie_ids of filesets + valkyrie_ids of child works] valkyrie_object_solr_document.member_ids = [string ids of filesets + string ids of child works + string ids of the filesets of child works]

Debug details ``` irb(main):020:0> im => # internal_resource="Image" created_at=Tue, 09 Apr 2024 20:45:54.986412000 UTC +00:00 updated_at=Tue, 09 Apr 2024 21:44:49.587084000 UTC +00:00 new_record=false alternate_ids=[] embargo_id=nil lease_id=nil title=["Image from a PDF"] date_modified=Tue, 09 Apr 2024 21:34:37 +0000 date_uploaded=Tue, 09 Apr 2024 21:34:37 +0000 depositor="admin@example.com" admin_set_id=# member_ids=[#, #] member_of_collection_ids=[] on_behalf_of=nil proxy_depositor=nil state=# rendering_ids=[] representative_id=# thumbnail_id=# abstract=[] access_right=[] alternative_title=[] arkivo_checksum="" based_near=[] bibliographic_citation=[] contributor=[] creator=["0~Smith, John", "1~"] date_created=[] description=[] identifier=[] import_url=nil keyword=[] publisher=[] label="" language=[] license=[] relative_path=nil related_url=[] resource_type=[] rights_notes=[] rights_statement=[] source=[] subject=[] extent=[] show_pdf_viewer="1" show_pdf_download_button="1" video_embed="" is_child=nil split_from_pdf_id=nil> irb(main):021:0> sd => #"ac7b2152-b361-4c77-b6e9-5c74d723a26d", "date_uploaded_dtsi"=>"2024-04-09T20:45:54Z", "date_modified_dtsi"=>"2024-04-09T21:34:44Z", "system_create_dtsi"=>"2024-04-09T20:45:54Z", "system_modified_dtsi"=>"2024-04-09T21:34:44Z", "has_model_ssim"=>["Image"], "human_readable_type_tesim"=>["Image"], "edit_access_group_ssim"=>["admin"], "edit_access_person_ssim"=>["admin@example.com"], "read_access_group_ssim"=>["public", "work_editor"], "visibility_ssi"=>"open", "thumbnail_path_ss"=>"/downloads/292ae741-4a43-45f2-8339-402d38a42703?file=thumbnail", "title_tesim"=>["Image from a PDF"], "depositor_tesim"=>["admin@example.com"], "suppressed_bsi"=>false, "admin_set_id_ssim"=>["1ddbc9f8-375d-428c-88e0-97c985ec0f94"], "admin_set_tesim"=>["Default Admin Set"], "isPartOf_ssim"=>["1ddbc9f8-375d-428c-88e0-97c985ec0f94"], "member_ids_ssim"=>["292ae741-4a43-45f2-8339-402d38a42703", "77161c4b-6f0b-4b3d-8b1e-8439c1d04e96", "9d1fa0f7-5cdf-43be-8d65-bd1ae245c6af"], "depositor_ssim"=>["admin@example.com"], "hasRelatedMediaFragment_ssim"=>["292ae741-4a43-45f2-8339-402d38a42703"], "hasRelatedImage_ssim"=>["292ae741-4a43-45f2-8339-402d38a42703"], "creator_tesim"=>["Smith, John", ""], "label_tesim"=>[""], "show_pdf_viewer_bsi"=>true, "show_pdf_download_button_bsi"=>true, "video_embed_tesi"=>"", "account_cname_tesim"=>["cat.hyku.test"], "account_institution_name_ssim"=>["cat.hyku.test"], "valkyrie_bsi"=>true, "_version_"=>1795895161321947136, "timestamp"=>"2024-04-09T21:44:50.310Z"}> irb(main):022:0> im.member_ids => [#, #] irb(main):023:0> sd.member_ids => ["292ae741-4a43-45f2-8339-402d38a42703", "77161c4b-6f0b-4b3d-8b1e-8439c1d04e96", "9d1fa0f7-5cdf-43be-8d65-bd1ae245c6af"] ```