Bug 17915 - warning in Stage MARC records for import when matching rule with offset
Summary: warning in Stage MARC records for import when matching rule with offset
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-16 15:42 UTC by Fridolin Somers
Modified: 2020-03-27 13:06 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 17915 - warning in Stage MARC records for import when matching rule with offset (1.62 KB, patch)
2017-01-17 08:18 UTC, Fridolin Somers
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2017-01-16 15:42:27 UTC
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.
Comment 1 Fridolin Somers 2017-01-17 08:18:50 UTC
Created attachment 59069 [details] [review]
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
Comment 2 Owen Leonard 2017-05-09 16:58:50 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2017-10-11 13:38:20 UTC
I was able to reproduce this problem in master, and the patch does make the error go away. However, I'm seeing a different error now:

stage-marc-import.pl: DBIx::Class::Storage::DBI::select_single(): Query returned more than one row.  SQL that returns multiple rows is DEPRECATED for ->find and ->single at /home/vagrant/kohaclone/Koha/Objects.pm line 92

Is this error within the scope of this bug?
Comment 4 Fridolin Somers 2020-03-27 13:06:16 UTC
(In reply to Owen Leonard from comment #3)
> I was able to reproduce this problem in master, and the patch does make the
> error go away. However, I'm seeing a different error now:
> 
> stage-marc-import.pl: DBIx::Class::Storage::DBI::select_single(): Query
> returned more than one row.  SQL that returns multiple rows is DEPRECATED
> for ->find and ->single at /home/vagrant/kohaclone/Koha/Objects.pm line 92
> 
> Is this error within the scope of this bug?

Oh could you test again please ?