Return an empty array if fieldTag is empty in MarcReader#16
Merged
demiankatz merged 4 commits intovufind-org:devfrom Apr 21, 2025
Merged
Return an empty array if fieldTag is empty in MarcReader#16demiankatz merged 4 commits intovufind-org:devfrom
demiankatz merged 4 commits intovufind-org:devfrom
Conversation
demiankatz
approved these changes
Apr 21, 2025
Member
demiankatz
left a comment
There was a problem hiding this comment.
@LuomaJuha, this makes sense to me! I confirmed that in PHP, the string '0' resolves to false but the string '000' resolves to true. I am not aware of any case where there's a 000 field in MARC, but if there were for some reason, this change would not break anything.
Member
|
@LuomaJuha, I've also released this as vufind-marc v1.2.0; feel free to open a PR against the release-10.2 branch of the main repository if you want to update this dependency right away; otherwise, it will get addressed soon anyway as part of the routine dependency updates for the 10.2 release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Noticed a small thing, but if there is an empty string value passed into the getFields by accident, it will pass through the if ($fieldTag &&... check and return first found field instead of an empty array
If this was an intentional behaviour, then this can be ignored and will close the pr.