Skip to content

Commit

Permalink
Fixed bug in rake task
Browse files Browse the repository at this point in the history
  • Loading branch information
dolsysmith committed Sep 11, 2024
1 parent 2b7e8d9 commit e7f4302
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/tasks/replace_license_value.rake
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def solr_results(old_value)
params = {:q => "license_tesim:\"http://www.europeana.eu/portal/rights/rr-r.html\"", fl:'id,license_tesim'}
r = ActiveFedora::SolrService.instance.conn.paginate(1, 1000, 'select', :params => params)
puts "Found #{r['response']['numFound']} documents with the old license value #{old_value}."
if r['response']['numFound'] > 0
puts "Updating docs..."
return
if r['response']['numFound'] == 0
return []
end
puts "Updating docs..."
docs = r.dig('response', 'docs')
page_num = 2
while (next_page = ActiveFedora::SolrService.instance.conn.paginate(page_num, 1000, 'select', :params => params).dig('response', 'docs')) != []
Expand Down

0 comments on commit e7f4302

Please sign in to comment.