Skip to content

Commit

Permalink
Merge pull request #301 from projecthydra/blacklight-5.16
Browse files Browse the repository at this point in the history
Upgrade to Blacklight 5.16 and remove deprecation warnings
  • Loading branch information
grosscol committed Nov 9, 2015
2 parents 9e3ef71 + 98ece04 commit a5562e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions hydra-access-controls/hydra-access-controls.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Gem::Specification.new do |gem|
gem.add_dependency 'activesupport', '~> 4.0'
gem.add_dependency "active-fedora", '~> 9.0'
gem.add_dependency 'cancancan', '~> 1.8'
gem.add_dependency 'deprecation', '~> 0.1'
gem.add_dependency "blacklight", '~> 5.10'
gem.add_dependency 'deprecation', '~> 0.2'
gem.add_dependency "blacklight", '~> 5.16'

# sass-rails is typically generated into the app's gemfile by `rails new`
# In rails 3 it's put into the "assets" group and thus not available to the
Expand Down
11 changes: 5 additions & 6 deletions hydra-access-controls/lib/hydra/permissions_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def permissions_doc(pid)
doc
end


protected

# a solr query method
Expand All @@ -22,8 +21,8 @@ def permissions_doc(pid)
def get_permissions_solr_response_for_doc_id(id=nil, extra_controller_params={})
raise Blacklight::Exceptions::InvalidSolrID.new("The application is trying to retrieve permissions without specifying an asset id") if id.nil?
solr_opts = permissions_solr_doc_params(id).merge(extra_controller_params)
response = ActiveFedora::SolrService.instance.conn.get('select', :params=> solr_opts)
solr_response = Blacklight::SolrResponse.new(response, solr_opts)
response = ActiveFedora::SolrService.instance.conn.get('select', params: solr_opts)
solr_response = Blacklight::Solr::Response.new(response, solr_opts)

raise Blacklight::Exceptions::InvalidSolrID.new("The solr permissions search handler didn't return anything for id \"#{id}\"") if solr_response.docs.empty?
Hydra::PermissionsSolrDocument.new(solr_response.docs.first, solr_response)
Expand All @@ -42,9 +41,9 @@ def permissions_solr_doc_params(id=nil)
id ||= params[:id]
# just to be consistent with the other solr param methods:
{
:qt => :permissions,
:id => id # this assumes the document request handler will map the 'id' param to the unique key field
qt: :permissions,
id: id # this assumes the document request handler will map the 'id' param to the unique key field
}
end
end
end
end

0 comments on commit a5562e2

Please sign in to comment.