Skip to content

Commit

Permalink
Merge pull request #174 from collectionspace/return-date-prep-early
Browse files Browse the repository at this point in the history
Return date prep early
  • Loading branch information
kspurgin authored Feb 11, 2024
2 parents 9587bed + 704b379 commit 9d66dfe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ This project bumps the version number for any changes (including documentation u

## [Unreleased] - i.e. pushed to main branch but not yet tagged as a release

## [5.0.6] - 2024-02-11
- Return date details responses early if there are errors, to avoid exceptions

## [5.0.5] - 2024-02-02
- For `date details` batch mode: add support for ingesting grouped fields at the same level as the structured date group. To find the group level of the structured date group, find the `date_field_group` value in the relevant CSV ingest template. If that field has a `REPEATING FIELD GROUP` value in the template, any other field values with the same `REPEATING FIELD GROUP` value can be ingested together.

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GIT
PATH
remote: .
specs:
collectionspace-mapper (5.0.5)
collectionspace-mapper (5.0.6)
activesupport (= 7.0.4.3)
chronic
collectionspace-client (~> 0.15.0)
Expand Down
13 changes: 10 additions & 3 deletions lib/collectionspace/mapper/date_details/data_prepper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def prep
if handler.grouped_handler
extract_grouped_data
grouped_prepped = handler.grouped_handler.prep(grouped_data)
unless grouped_prepped.errors.empty?
grouped_prepped.errors.each { |err| response.add_error(err) }
return response
end
end
split_data
transform_data
Expand All @@ -42,6 +46,8 @@ def prep
clean_transformed
readd_id
combine_data_fields
return response unless response.errors.empty?

merge_authority_data(auth_prepped) if authority_data
merge_grouped_data(grouped_prepped) if grouped_data
response
Expand Down Expand Up @@ -209,9 +215,10 @@ def merge_authority_data(auth_prepped)
def merge_grouped_data(grouped_prepped)
path = handler.target_path

response.combined_data[path].merge!(
grouped_prepped.combined_data[path]
)
response.combined_data[path].tap { |data| binding.pry unless data }
.merge!(
grouped_prepped.combined_data[path]
)
grouped_prepped.errors.each { |err| response.add_error(err) }
grouped_prepped.terms.each { |term| response.add_term(term) }
grouped_prepped.warnings.each do |warning|
Expand Down
2 changes: 1 addition & 1 deletion lib/collectionspace/mapper/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module CollectionSpace
module Mapper
VERSION = "5.0.5"
VERSION = "5.0.6"
end
end

0 comments on commit 9d66dfe

Please sign in to comment.