Implement "Missing Subfield" Rule Validation

Description

Purpose/Overview:
Implement "Missing Subfield" Rule Validation

Requirements/Scope:

  1. Validation fails when subfield is required but does not exist in a record's field

Acceptance criteria:

  • Covered by unit tests

  • Rebuilt mod-quick-marc master branch after this change merged.

Environment

None

Potential Workaround

None

Attachments

7

Checklist

hide

Activity

Show:

Valery_PilkoSeptember 9, 2024 at 7:26 AM

Re-tested on Snapshot environment - found issue is fixed.
See attached screenshot:

Ready for PO review

Pavlo SmahinSeptember 5, 2024 at 7:23 PM

Hey , I’m expecting this issue to be fixed on the back-end side.

Valery_PilkoSeptember 5, 2024 at 4:37 PM
Edited

Tested on Snapshot-2 environment - works as expected in general (when fields don’t have required subfields).
See attached screenshots:
MARC bib:

MARC authority:

 

 


But I’ve found a way how to work around validation of the required subfield. And looks like it should be handled on UI sided. So, please review following case:
1. Subfields “$a” and “$l” are marked as “required” for “245” field, in MARC bib validation rules.
2. User tries to save MARC bib field with empty “$l”, ex.:
- “$a Edit MARC bib without required standard and appended $l“ - in this case, record will not be saved because of error during saving on back-end side.
or with space only in “$l” subfield:
- “$a Edit MARC bib without required standard and appended $l “

Expected result: return error: “Fail: Subfield ‘l' is required."
Actual result: UI sends empty subfield to ‘validate’ endpoint, and it passes validation. My guess is that UI shouldn’t send an empty subfield.

Svitlana KovalovaSeptember 5, 2024 at 9:48 AM

the issue is fixed

Valery_PilkoSeptember 5, 2024 at 7:51 AM

Hi
Tested on Snapshot env, following issue found:
”400” error is returned by “validate” endpoint when MARC field doesn’t have required subfield.
Error message is: "An odd number of parameters were passed to buildMap; even amounts are needed to construct key-value pairs"
In following example, subfields “$a” and “$l” of “245” field are marked as required in MARC validation rules.

Configured MARC validation rule example:

Saving of the record without required subfields in “245” field:

Saving of the record with required subfields in “245” field:



Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Spitfire

Fix versions

Release

Ramsons (R2 2024)

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created July 19, 2024 at 7:25 PM
Updated September 13, 2024 at 1:29 PM
Resolved September 13, 2024 at 1:29 PM
TestRail: Cases
TestRail: Runs