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

Behavior of MARC::Record data_fields, each_data_field, and data_fields_by_tag extension methods is counterintuitive #1

Open
dmolesUC opened this issue Mar 23, 2022 · 2 comments

Comments

@dmolesUC
Copy link
Contributor

data_fields_by_tag

Expected

  • returns all data fields in the original record, including fields with non-standard tags (e.g. "FFT" for TIND records)
  • returns only MARC::DataField objects

Actual

  • returns only fields with valid numeric tags in the range 010-999
  • returns MARC::ControlField objects, if they have a tag in the data field range

data_fields / each_data_field

  • returns/yields all data fields in the original record, including fields with non-standard tags (e.g. "FFT" for TIND records)
  • returns/yields only MARC::DataField objects
  • preserves the original order of fields

Actual

  • returns/yields only fields with valid numeric tags in the range 010-999
  • returns/yields MARC::ControlField objects, if they have a tag in the data field range
  • reorders fields by tag
@dmolesUC
Copy link
Contributor Author

See BerkeleyLibrary/tind #4 for an example of the kind of problem this can cause.

@dmolesUC
Copy link
Contributor Author

Note, though, that fixing this could be a breaking change for users that rely on the order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant