Skip to content

Commit

Permalink
Merge pull request #23 from hathitrust/DEV-557_log_and_ignore_missing…
Browse files Browse the repository at this point in the history
…_access_statements

Put guards around access statement derivation to ignore weird old combinations
  • Loading branch information
aelkiss authored Jan 16, 2023
2 parents d03d7a8 + 3cded38 commit aaa8cdb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/oai_solr/dublin_core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,16 @@ def description(record)
record.marc_record.fields("974").each do |field|
rights_attr = field["r"]
access_profile = access_profile(field["c"], field["s"])

statements.add Services.rights_database.access_statements_map.map[[rights_attr, access_profile]]
if access_profile.nil?
logger.error "Access profile not found for #{field}"
next
end
statement = Services.rights_database.access_statements_map[attribute: rights_attr, access_profile: access_profile]
if statement.nil?
logger.error("Access statement not found for #{field}")
next
end
statements.add statement
end
statements.to_a.sort_by(&:head)
end
Expand Down

0 comments on commit aaa8cdb

Please sign in to comment.