Bugzilla – Attachment 120474 Details for
Bug 28290
Record matching rules with no subfields cause ISE
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28290: Don't send subfields to 'as_string' if none to send
Bug-28290-Dont-send-subfields-to-asstring-if-none-.patch (text/plain), 2.81 KB, created by
Nick Clemens (kidclamp)
on 2021-05-04 18:31:49 UTC
(
hide
)
Description:
Bug 28290: Don't send subfields to 'as_string' if none to send
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-05-04 18:31:49 UTC
Size:
2.81 KB
patch
obsolete
>From eb3aac1a4aabb9ecc12c6fc4cb8cf6d79a9d72a1 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 4 May 2021 18:29:05 +0000 >Subject: [PATCH] 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! >--- > C4/Matcher.pm | 5 ++++- > koha-tmpl/intranet-tmpl/prog/en/includes/tools-item-action.inc | 1 + > 2 files changed, 5 insertions(+), 1 deletion(-) > >diff --git a/C4/Matcher.pm b/C4/Matcher.pm >index 923b4accf1..f2af720b35 100644 >--- a/C4/Matcher.pm >+++ b/C4/Matcher.pm >@@ -25,6 +25,7 @@ use Koha::SearchEngine; > use Koha::SearchEngine::Search; > use Koha::SearchEngine::QueryBuilder; > use Koha::Util::Normalize qw/legacy_default remove_spaces upper_case lower_case ISBN/; >+use Carp::Always; > > =head1 NAME > >@@ -833,10 +834,12 @@ sub _get_match_keys { > } > elsif ( $field->is_control_field() ) { > $string = $field->data(); >- } else { >+ } elsif ( defined $component->{subfields} && keys %{$component->{subfields}} ){ > $string = $field->as_string( > join('', keys %{ $component->{ subfields } }), ' ' # ' ' as separator > ); >+ } else { >+ $string = $field->as_string(); > } > > if ($component->{'length'}>0) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-item-action.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-item-action.inc >index 27fb6dadbd..e58f05f551 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-item-action.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-item-action.inc >@@ -1,5 +1,6 @@ > [% IF item_action_ignore AND num_items == 0 %] > No items were found during staging >+ <input type ="hidden" name="item_action" value="ignore"> > [% ELSE %] > <select name="item_action" id="item_action"> > [% IF ( item_action_always_add ) %] >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28290
:
120474
|
120475
|
120686
|
120827
|
120828
|
140066
|
140067
|
140263
|
140264