Skip to content
Snippets Groups Projects
Commit 393e096e authored by Gyan Gupta's avatar Gyan Gupta
Browse files

Allow draft works to show in catalog search page

parent 36860412
Branches bug_fix/allow-draft-works-to-show-in-catalog-search
Tags
1 merge request!305Allow draft works to show in catalog search page
Pipeline #14465 passed
# frozen_string_literal: true
module Hyrax
# Injects a search builder filter to hide documents marked as suppressed
module FilterSuppressed
extend ActiveSupport::Concern
included do
self.default_processor_chain += [:only_active_works]
end
def only_active_works(solr_parameters)
return if blacklight_params[:controller] == 'catalog'
solr_parameters[:fq] ||= []
solr_parameters[:fq] << '-suppressed_bsi:true'
end
end
end
\ No newline at end of file
Rails.configuration.to_prepare do
Hyrax::CatalogSearchBuilder.class_eval do
# overide show works that are in the active state or not for catalog only.
def show_only_active_records(solr_parameters)
return if blacklight_params[:controller] == 'catalog'
solr_parameters[:fq] ||= []
solr_parameters[:fq] << '-suppressed_bsi:true'
end
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment