Bugzilla – Attachment 59069 Details for
Bug 17915
warning in Stage MARC records for import when matching rule with offset
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17915 - warning in Stage MARC records for import when matching rule with offset
Bug-17915---warning-in-Stage-MARC-records-for-impo.patch (text/plain), 1.62 KB, created by
Fridolin Somers
on 2017-01-17 08:18:50 UTC
(
hide
)
Description:
Bug 17915 - warning in Stage MARC records for import when matching rule with offset
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2017-01-17 08:18:50 UTC
Size:
1.62 KB
patch
obsolete
>From 52e6f981012125953e6c46611307215c74b24bdf Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 17 Jan 2017 09:14:00 +0100 >Subject: [PATCH] Bug 17915 - warning in Stage MARC records for import when > matching rule with offset > >When using Stage MARC records for import with a matching rule where an offset is defined, the input string may be empty or shorter than the offset. >This generated a warning : >stage-marc-import.pl: substr outside of string at /home/koha/src/C4/Matcher.pm line 822. > >Test plan : >- define a matching rule on ISBN with length 0 and offset 999 (too big for any value) >- import some MARC records with this matching rule >- check the perl warns >=> Without patch you see warns : "substr outside of string at /home/koha/src/C4/Matcher.pm" >=> With patch no such warn >- edit the matching rule to set offset 0 >- import some MARC records, with matching ISBN, with this matching rule >=> Import must match existing records with same ISBN >--- > C4/Matcher.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/C4/Matcher.pm b/C4/Matcher.pm >index 40e6e5f..92549a7 100644 >--- a/C4/Matcher.pm >+++ b/C4/Matcher.pm >@@ -816,7 +816,9 @@ sub _get_match_keys { > ); > } > >- if ($component->{'length'}>0) { >+ if ( $component->{'offset'} > length($string) ) { >+ $string = ''; >+ } elsif ($component->{'length'}>0) { > $string= substr($string, $component->{'offset'}, $component->{'length'}); > } elsif ($component->{'offset'}) { > $string= substr($string, $component->{'offset'}); >-- >2.7.4
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 17915
: 59069