Skip to content

Commit

Permalink
🐛 Bring fix for entry show page not showing link
Browse files Browse the repository at this point in the history
This commit will bring in a fix from Bulkrax that correctly shows the
object from the entry show page.

ref:
  - samvera/bulkrax@0e68a5e
  • Loading branch information
kirkkwang committed Oct 4, 2023
1 parent 825b40e commit 26ae013
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/factories/bulkrax/object_factory_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ module ObjectFactoryDecorator
def environment(attrs)
Hyrax::Actors::Environment.new(object, Ability.new(@user), attrs, true)
end

# TODO: Verify and remove this once Bulkrax is updated 5.4.1 over greater and this is no longer needed
def search_by_identifier
# ref: https://github.com/samvera-labs/bulkrax/issues/866
# ref:https://github.com/samvera-labs/bulkrax/issues/867
# work_index = ::ActiveFedora.index_field_mapper.solr_name(work_identifier, :facetable)
work_index = work_identifier
query = { work_index =>
source_identifier_value }
# Query can return partial matches (something6 matches both something6 and something68)
# so we need to weed out any that are not the correct full match. But other items might be
# in the multivalued field, so we have to go through them one at a time.
match = klass.where(query).detect { |m| m.send(work_identifier).include?(source_identifier_value) }
return match if match
end
end
end

Expand Down

0 comments on commit 26ae013

Please sign in to comment.