-
Notifications
You must be signed in to change notification settings - Fork 4
Change SDR Graveyard in contentable concern #347
Comments
clarification question: is there anything behaving as if the graveyard APO druid is the one listed in the comment? the comment doesn't match the desired druid, which it seems like we should fix. but digging into the code a bit, it actually appears to look up the APO by title: and that title lookup seems to find |
^^ Hi @jmartin-sul - that's a good clarification. When we try to run decommission, it gives the following error: "ArgumentError: Couldn't find ActiveFedora::Base without an ID" . I assumed at first it was looking for the wrong druid (when I saw the note), but now suspect something more complex is going on. |
huh, interesting. did some testing in rails console with the dor-services methods (on argo-stage). TL;DR, it appears we're not using the right approach to get the my terminal investigation: [1] pry(main)> Dor::SearchService.sdr_graveyard_apo_druid
=> nil
[2] pry(main)> Dor::SearchService.find_sdr_graveyard_apo_druid
=> nil
[3] pry(main)>
...
[1] pry(main)> r = Dor::SearchService.query('dc_title_tesim:"SDR Graveyard"', :fl => 'id')
=> {"responseHeader"=>
{"zkConnected"=>true,
"status"=>0,
"QTime"=>2,
"params"=>{"q"=>"dc_title_tesim:\"SDR Graveyard\"", "fl"=>"id", "start"=>"0", "wt"=>"json"}},
"response"=>{"numFound"=>1, "start"=>0, "docs"=>[{"id"=>"druid:kg712km1576"}]},
"facet_counts"=>
{"facet_queries"=>{},
"facet_fields"=>{"active_fedora_model_ssi"=>["Dor::AdminPolicyObject", 1], "object_type_si"=>[]},
"facet_ranges"=>{},
"facet_intervals"=>{},
"facet_heatmaps"=>{}},
"spellcheck"=>{"suggestions"=>[], "correctlySpelled"=>true}}
[2] pry(main)>
[3] pry(main)> r['response']
=> {"numFound"=>1, "start"=>0, "docs"=>[{"id"=>"druid:kg712km1576"}]}
[4] pry(main)> r['response']['docs']
=> [{"id"=>"druid:kg712km1576"}]
[5] pry(main)> r['response']['docs'].first
=> {"id"=>"druid:kg712km1576"}
[6] pry(main)>
[7] pry(main)> r['response']['docs'].first[:id]
=> nil
[8] pry(main)>
[9] pry(main)>
[10] pry(main)> r['response']['docs'].first['id']
=> "druid:kg712km1576" |
Thanks for this analysis @jmartin-sul - that's a great result. Should we keep work on this ticket or open a new one (somewhere appropriate)? |
i vote for opening a new ticket, and we can reference and close this one. in addition to fixing the way the solr response is accessed, we should list fixing the thing you initially found with the incorrect/misleading comment (either by using the right druid or just not referencing one, i'm not sure how helpful that comment was, or whether it might fall out of date again). or the new ticket could just be about the solr response and this ticket could be about the comment (and kept open in that case). |
https://github.com/sul-dlss/dor-services/blob/master/lib/dor/models/concerns/contentable.rb#L216 references the wrong APO druid - should be: druid:kg712km1576
The text was updated successfully, but these errors were encountered: