You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm seeing a number of deprecation warnings in the Rails log surrounding @document which was deprecated here
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from render_refworks_action? at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/lib/blacklight/marc/catalog.rb:25)
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from render_refworks_action? at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/lib/blacklight/marc/catalog.rb:25)
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from render_endnote_action? at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/lib/blacklight/marc/catalog.rb:29)
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from render_endnote_action? at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/lib/blacklight/marc/catalog.rb:29)
I am not sure how this can be fixed. I tried the following, but just got new warnings:
diff --git a/lib/blacklight/marc/catalog.rb b/lib/blacklight/marc/catalog.rb
index 29b3830..8508cbc 100644
--- a/lib/blacklight/marc/catalog.rb+++ b/lib/blacklight/marc/catalog.rb@@ -22,15 +22,15 @@ module Blacklight::Marc
private
def render_refworks_action? config, options = {}
- options[:document] && options[:document].respond_to?(:export_formats) && options[:document].export_formats.keys.include?(:refworks_marc_txt )+ @response.docs.first && @response.docs.first.respond_to?(:export_formats) && @response.docs.first.export_formats.keys.include?(:refworks_marc_txt )
end
def render_endnote_action? config, options = {}
- options[:document] && options[:document].respond_to?(:export_formats) && options[:document].export_formats.keys.include?(:endnote )+ @response.docs.first && @response.docs.first.respond_to?(:export_formats) && @response.docs.first.export_formats.keys.include?(:endnote )
end
def render_librarian_view_control? config, options = {}
- respond_to? :librarian_view_solr_document_path and options[:document] and options[:document].respond_to?(:to_marc)+ respond_to? :librarian_view_solr_document_path and @response.docs.first and @response.docs.first.respond_to?(:to_marc)
end
end
And the warning here was:
DEPRECATION WARNING: The @response instance variable is deprecated; use @document.response instead. (called from render_refworks_action? at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/lib/blacklight/marc/catalog.rb:25)
This is the whole list of deprecation warning I am seeing when I am using Blacklight 7.1.0 with blacklight-marc:
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from render_refworks_action? at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/lib/blacklight/marc/catalog.rb:25)
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from render_refworks_action? at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/lib/blacklight/marc/catalog.rb:25)
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from render_endnote_action? at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/lib/blacklight/marc/catalog.rb:29)
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from render_endnote_action? at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/lib/blacklight/marc/catalog.rb:29)
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from single_endnote_catalog_path at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/app/helpers/blacklight_marc_helper.rb:16)
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from render_refworks_action? at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/lib/blacklight/marc/catalog.rb:25)
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from render_refworks_action? at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/lib/blacklight/marc/catalog.rb:25)
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from render_endnote_action? at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/lib/blacklight/marc/catalog.rb:29)
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from render_endnote_action? at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/lib/blacklight/marc/catalog.rb:29)
DEPRECATION WARNING: The @document instance variable is deprecated and will be removed in Blacklight-marc 8.0 (called from single_endnote_catalog_path at /Users/cdm32/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/bundler/gems/blacklight-marc-c0ff1d9cb5d3/app/helpers/blacklight_marc_helper.rb:16)
The text was updated successfully, but these errors were encountered:
I'm starting to wonder, looking at this again today with fresh eyes, if maybe this deprecation was done in error. If you look at Blacklight::Catalog#show it deprecates @response, see https://github.com/projectblacklight/blacklight/blob/master/app/controllers/concerns/blacklight/catalog.rb#L47-L48 as it is returned from search_service.fetch(params[:id]) - @document is still ok to use in the catalog#show context (what these view partials in this repo inherit)
This is different from Blacklight::Catalog#index which deprecates @document_list (as returned from search_service.search_results).
I'm seeing a number of deprecation warnings in the Rails log surrounding
@document
which was deprecated hereI am not sure how this can be fixed. I tried the following, but just got new warnings:
And the warning here was:
This is the whole list of deprecation warning I am seeing when I am using Blacklight 7.1.0 with blacklight-marc:
The text was updated successfully, but these errors were encountered: