Skip to content
This repository was archived by the owner on Mar 24, 2020. It is now read-only.

Commit ea730e7

Browse files
committed
Update the query
Update query for testing Update query for testing Revert the change for qa deploy Update query Update query and revert qa deploy Update query to fix failed test Update query to fix failed test Update solr query Remove comments Update qa deploy config Fix collection view error Fix error Fix error Fix error Fix error Revert qa deploy config change Remove un-used code
1 parent 44bc893 commit ea730e7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

app/controllers/dams_resource_controller.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ def show
4040
# generate facet collection list for collection page only
4141
models = @document["active_fedora_model_ssi"]
4242
if models.include?("DamsAssembledCollection") || models.include?("DamsProvenanceCollection") || models.include?("DamsProvenanceCollectionPart")
43-
other_rights_query = "(otherRights_tesim:localDisplay OR otherRights_tesim:metadataDisplay) AND collections_tesim:#{params[:id]}"
44-
@res, @doc = get_search_results(q: other_rights_query, rows: 1)
45-
@metadata_only = !@res.response['numFound'].zero?
43+
other_rights_fquery = "(otherRights_tesim:localDisplay OR otherRights_tesim:metadataDisplay)"
44+
collection_solr_params = { :q => "collections_tesim:#{params[:id]}", :fq => other_rights_fquery, :rows => 1 }
45+
collection_response, collection_documents = get_search_results(collection_solr_params, :spellcheck => "false")
46+
@metadata_only = !collection_response.response['numFound'].zero?
4647

4748
facet_collection_params = { :f=>{"collection_sim"=>"#{@document['title_tesim'].first.to_s}"}, :id=>params[:id], :rows => 0 }
4849
apply_gated_discovery( facet_collection_params, nil )
@@ -73,8 +74,7 @@ def show
7374
end
7475

7576
# enforce access controls
76-
if can? :show, @document
77-
77+
if can?(:show, @document) || @document['discover_access_group_ssim'].include?("public")
7878
# find related resources
7979
collectionData = @document["collection_json_tesim"]
8080
@collectionDocArray = Array.new
@@ -106,7 +106,7 @@ def show
106106
end
107107
elsif @document['discover_access_group_ssim'].include?("public")
108108
respond_to do |format|
109-
format.html { render :metadata }
109+
format.html
110110
format.json { render json: @document }
111111
format.rdf { render xml: @rdfxml }
112112
format.nt { rdf_nt }

spec/features/dams_collections_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@
353353
@copyright = DamsCopyright.create status: 'Under copyright'
354354
@metadataOnlyObj = DamsObject.create titleValue: 'Test Object with metadataOnly Display', provenanceCollectionURI: @metadataOnlyCollection.pid, copyrightURI: @copyright.pid, otherRightsURI: @metadataDisplay.pid
355355
@localObj = DamsObject.create titleValue: 'Test Object with localDisplay', provenanceCollectionURI: @localOnlyCollection.pid, copyrightURI: @copyright.pid, otherRightsURI: @localDisplay.pid
356-
@obj = DamsObject.create titleValue: 'Test Object with no localDisplay, no metadataOnlyDisplay', provenanceCollectionURI: @localOnlyCollection.pid, copyrightURI: @copyright.pid
356+
@obj = DamsObject.create titleValue: 'Test Object with no localDisplay, no metadataOnlyDisplay', provenanceCollectionURI: @collection.pid, copyrightURI: @copyright.pid
357357
solr_index @localDisplay.pid
358358
solr_index @metadataDisplay.pid
359359
solr_index @metadataOnlyCollection.pid

0 commit comments

Comments
 (0)