Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I754 #756

Merged
merged 2 commits into from
Mar 8, 2023
Merged

I754 #756

merged 2 commits into from
Mar 8, 2023

Conversation

jeremyf
Copy link
Contributor

@jeremyf jeremyf commented Mar 7, 2023

Avoid building value/object if hyrax_record does not respond

bd42b4a

Prior to this commit, we'd attempt to export the field even if the
"from" object did not respond to that property. That would raise a
NoMethodError.

With this commit, we're skipping the building of the value/object if the
hyrax_record does not respond to the source method.

Related to:

Fixing bug regarding total and export limits

951128d

The current_record_ids was removed in 4cf0207 (e.g. #749) in favor of
current_records_for_export; however the Bulkrax::CsvParser#total
method was not updated to reflect this change.

In this commit, we fix that issue. Also we tighten up the logic
regarding the sorted_entries array. There was an assumption that we
would have a nil limit; but the documentation mentions that 0 and
nil are equivalent. But (0..(0 || total)) is different from
(0..(nil || total)).

Partially closes #754

jeremyf added 2 commits March 7, 2023 12:26
Prior to this commit, we'd attempt to export the field even if the
"from" object did not respond to that property.  That would raise a
`NoMethodError`.

With this commit, we're skipping the building of the value/object if the
hyrax_record does not respond to the source method.

Related to:

- notch8/britishlibrary#289
- #754
The `current_record_ids` was removed in 4cf0207 (e.g. #749) in favor of
`current_records_for_export`; however the `Bulkrax::CsvParser#total`
method was not updated to reflect this change.

In this commit, we fix that issue.  Also we tighten up the logic
regarding the sorted_entries array.  There was an assumption that we
would have a `nil` limit; but the documentation mentions that 0 and
`nil` are equivalent.  But `(0..(0 || total))` is different from
`(0..(nil || total))`.

Partially closes #754
jeremyf added a commit to notch8/britishlibrary that referenced this pull request Mar 7, 2023
This commit includes two primary things:

- CsvParser fix to logic (see samvera/bulkrax#756)
- CsvEntry fix for creator property disparity between FileSets and other works

Without this hack, when we export a FileSet, it skips exporting the
FileSet's creator.  This is because we are overloading the `creator` in
the parser.  With this change, the complex `creator` object for works
will export correctly (e.g. have the constituent field parts in the
CSV).  And the FileSet will have a `creator` column.

Related to:

- #289
- samvera/bulkrax#756
@jeremyf jeremyf mentioned this pull request Mar 7, 2023
@jeremyf jeremyf added patch-ver for release notes bug-fix labels Mar 7, 2023
jeremyf added a commit to notch8/britishlibrary that referenced this pull request Mar 7, 2023
This commit includes two primary things:

- CsvParser fix to logic (see samvera/bulkrax#756)
- CsvEntry fix for creator property disparity between FileSets and other works

Without this hack, when we export a FileSet, it skips exporting the
FileSet's creator.  This is because we are overloading the `creator` in
the parser.  With this change, the complex `creator` object for works
will export correctly (e.g. have the constituent field parts in the
CSV).  And the FileSet will have a `creator` column.

Related to:

- #289
- samvera/bulkrax#756
@jeremyf jeremyf merged commit e7d58e6 into main Mar 8, 2023
@jeremyf jeremyf deleted the i754 branch March 8, 2023 14:01
jeremyf added a commit to notch8/adventist-dl that referenced this pull request Mar 8, 2023
There are two fixes this includes:

- Avoid building value/object if hyrax_record does not respond
- Fixing bug regarding total and export limits

Related to:

- samvera/bulkrax#756
jeremyf added a commit to notch8/britishlibrary that referenced this pull request Mar 8, 2023
The Bulkrax update provides the following fixes:

- Avoid building value/object if hyrax_record does not respond
- Fixing bug regarding total and export limits

As such, some of the overrides are no longer needed.

Related to:

- samvera/bulkrax#756
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix patch-ver for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export of FileSet fails when parser field for creator is an object
3 participants