From f6a5becd0a2b63ce3bffee2db5319a7d75d86d20 Mon Sep 17 00:00:00 2001 From: Shana Moore Date: Wed, 24 Apr 2024 14:22:14 -0700 Subject: [PATCH] :bug: Account for Valkyrie ID in location indexer In #extract_id we were receiving an error because it didn't account for a Valkyrie::ID in its case statement. This commit adds a case for Valkyrie::ID. --- app/indexers/concerns/hyrax/location_indexer.rb | 2 +- app/services/hyrax/location_service.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/indexers/concerns/hyrax/location_indexer.rb b/app/indexers/concerns/hyrax/location_indexer.rb index 7f6fbcf55d..0d97e3f31a 100644 --- a/app/indexers/concerns/hyrax/location_indexer.rb +++ b/app/indexers/concerns/hyrax/location_indexer.rb @@ -14,7 +14,7 @@ def to_solr def based_near_label_lookup(locations) locations.map do |loc| - location_service.full_label(loc) + location_service.full_label(loc.to_s) end end diff --git a/app/services/hyrax/location_service.rb b/app/services/hyrax/location_service.rb index 1fe9803232..c0efa08a49 100644 --- a/app/services/hyrax/location_service.rb +++ b/app/services/hyrax/location_service.rb @@ -19,7 +19,7 @@ def full_label(uri) def extract_id(obj) uri = case obj - when String + when String, Valkyrie::ID URI(obj) when URI obj