From c2ce208b3666499d4f6d1b90b41576152ed1a913 Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Mon, 17 Dec 2018 16:49:29 -0800 Subject: [PATCH] Remove document.id fallback from document_show_link_field helper; it was always weird and never worked the way one might expect --- app/helpers/blacklight/configuration_helper_behavior.rb | 1 - .../blacklight/configuration_helper_behavior_spec.rb | 6 ------ 2 files changed, 7 deletions(-) diff --git a/app/helpers/blacklight/configuration_helper_behavior.rb b/app/helpers/blacklight/configuration_helper_behavior.rb index 6f7471bbed..521b3921cb 100644 --- a/app/helpers/blacklight/configuration_helper_behavior.rb +++ b/app/helpers/blacklight/configuration_helper_behavior.rb @@ -163,7 +163,6 @@ def document_show_link_field document = nil field = fields.first if document.nil? field ||= fields.find { |f| document.has? f } field &&= field.try(:to_sym) - field ||= document.id field end diff --git a/spec/helpers/blacklight/configuration_helper_behavior_spec.rb b/spec/helpers/blacklight/configuration_helper_behavior_spec.rb index e7df0e6ec8..d5932ca058 100644 --- a/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +++ b/spec/helpers/blacklight/configuration_helper_behavior_spec.rb @@ -114,12 +114,6 @@ f = helper.document_show_link_field document expect(f).to eq :b end - - it "fallbacks on the id" do - blacklight_config.index.title_field = [:zzz, :yyy] - f = helper.document_show_link_field document - expect(f).to eq 123 - end end describe "#view_label" do