Description
Nick Clemens (kidclamp)
2021-05-04 18:28:31 UTC
Created attachment 120474 [details] [review] Bug 28290: Don't send subfields to 'as_string' if none to send This fixes an error where we send a blank string to Marc::Field->as_string The subroutine fails as the regex is marked as incomplete as there is nothing between the brackets Also fixes a missing hidden input for 'item_action' when no items are staged during import 1 - Define a new matching rule with no subfields Match-threshold: 1000 Record type: bibliographic record Search-index: Other-control-number Score: 1000 Tag: 035 Subfields: Offset: Length: 2 - Attempt to stage a record with an 035 using this rule (i will attach example to bug) 3 - Staging fails 4 - Stage again with no matching rule 5 - Manage the staged record, try to apply the matching rule 6 - It fails, 500 error 7 - Apply patch 8 - Restart all the things 9 - Apply rule again, it works! 10 - Stage the record again using the rule for matching 11 - It stages and matches! Created attachment 120475 [details]
Test record
Created attachment 120686 [details] [review] Bug 28290: Don't send subfields to 'as_string' if none to send This fixes an error where we send a blank string to Marc::Field->as_string The subroutine fails as the regex is marked as incomplete as there is nothing between the brackets Also fixes a missing hidden input for 'item_action' when no items are staged during import 1 - Define a new matching rule with no subfields Match-threshold: 1000 Record type: bibliographic record Search-index: Other-control-number Score: 1000 Tag: 035 Subfields: Offset: Length: 2 - Attempt to stage a record with an 035 using this rule (i will attach example to bug) 3 - Staging fails 4 - Stage again with no matching rule 5 - Manage the staged record, try to apply the matching rule 6 - It fails, 500 error 7 - Apply patch 8 - Restart all the things 9 - Apply rule again, it works! 10 - Stage the record again using the rule for matching 11 - It stages and matches! Signed-off-by: Owen Leonard <oleonard@myacpl.org> QA script explodes a bit - missing a dependency maybe? Can you please verify/check? FAIL C4/Matcher.pm OK critic OK forbidden patterns OK git manipulation OK pod FAIL pod coverage POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666 OK spelling FAIL valid Can't locate Carp/Always.pm in @INC (you may need to install the Carp::Always module) (@INC contains: /home/vagrant/kohaclone /home/vagrant/qa-test-tools /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base /var/lib/koha/kohadev/plugins) Created attachment 120827 [details] [review] Bug 28290: Don't send subfields to 'as_string' if none to send This fixes an error where we send a blank string to Marc::Field->as_string The subroutine fails as the regex is marked as incomplete as there is nothing between the brackets Also fixes a missing hidden input for 'item_action' when no items are staged during import 1 - Define a new matching rule with no subfields Match-threshold: 1000 Record type: bibliographic record Search-index: Other-control-number Score: 1000 Tag: 035 Subfields: Offset: Length: 2 - Attempt to stage a record with an 035 using this rule (i will attach example to bug) 3 - Staging fails 4 - Stage again with no matching rule 5 - Manage the staged record, try to apply the matching rule 6 - It fails, 500 error 7 - Apply patch 8 - Restart all the things 9 - Apply rule again, it works! 10 - Stage the record again using the rule for matching 11 - It stages and matches! Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 120828 [details] [review] Bug 28290: (follow-up) Remove debug code Looks good.. but, it looks like C4::Matcher is fairly well tested.. could you add a test for this change too? Still valid ? Created attachment 140066 [details] [review] Bug 28290: Don't send subfields to 'as_string' if none to send This fixes an error where we send a blank string to Marc::Field->as_string The subroutine fails as the regex is marked as incomplete as there is nothing between the brackets Also fixes a missing hidden input for 'item_action' when no items are staged during import 1 - Define a new matching rule with no subfields Match-threshold: 1000 Record type: bibliographic record Search-index: Other-control-number Score: 1000 Tag: 035 Subfields: Offset: Length: 2 - Attempt to stage a record with an 035 using this rule (i will attach example to bug) 3 - Staging fails 4 - Stage again with no matching rule 5 - Manage the staged record, try to apply the matching rule 6 - It fails, 500 error 7 - Apply patch 8 - Restart all the things 9 - Apply rule again, it works! 10 - Stage the record again using the rule for matching 11 - It stages and matches! Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 140067 [details] [review] Bug 28290: (follow-up) Unit test Created attachment 140263 [details] [review] Bug 28290: Don't send subfields to 'as_string' if none to send This fixes an error where we send a blank string to Marc::Field->as_string The subroutine fails as the regex is marked as incomplete as there is nothing between the brackets Also fixes a missing hidden input for 'item_action' when no items are staged during import 1 - Define a new matching rule with no subfields Match-threshold: 1000 Record type: bibliographic record Search-index: Other-control-number Score: 1000 Tag: 035 Subfields: Offset: Length: 2 - Attempt to stage a record with an 035 using this rule (i will attach example to bug) 3 - Staging fails 4 - Stage again with no matching rule 5 - Manage the staged record, try to apply the matching rule 6 - It fails, 500 error 7 - Apply patch 8 - Restart all the things 9 - Apply rule again, it works! 10 - Stage the record again using the rule for matching 11 - It stages and matches! Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 140264 [details] [review] Bug 28290: (follow-up) Unit test Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Pushed to master for 22.11. Nice work everyone, thanks! Backported to 22.05.x for upcoming 22.05.07 release applied to 21.11.x for 21.11.14 Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document it seems, marking resolved. |