Bug 11269

Summary: Latest MARC::Record makes visible some wrong usage of field->subfield in C4::Search
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Galen Charlton <gmcharlt>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: fridolin.somers, mtompset
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11183
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 11269 - Latest MARC::Record makes visible some wrong usage of field->subfield in C4::Search
Bug 11269 - Latest MARC::Record makes visible some wrong usage of field->subfield in C4::Search

Description Tomás Cohen Arazi 2013-11-18 22:04:47 UTC
To reproduce:
- Run prove -v t/db_dependent/Search.t
- There will be warnings about "Use of uninitialized value $code_wanted in string" in MARC::Field.
Comment 1 Tomás Cohen Arazi 2013-11-18 22:06:21 UTC Comment hidden (obsolete)
Comment 2 Liz Rea 2013-11-18 22:32:10 UTC
Created attachment 23009 [details] [review]
Bug 11269 - Latest MARC::Record makes visible some wrong usage of field->subfield in C4::Search

To test:
- Run prove -v t/db_dependent/Search.t
- There will be warnings about "Use of uninitialized value $code_wanted in string" in MARC::Field.
- Apply the patch.
- Those warnings are gone.

Regards
To+

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Tests now pass
Comment 3 Galen Charlton 2013-11-19 16:29:39 UTC
I've pushed this to master and 3.14.x.  Thanks, Tomás!
Comment 4 Tomás Cohen Arazi 2013-11-20 16:43:17 UTC
This patch has been pushed to 3.12.x, will be in 3.12.7.
Comment 5 Mark Tompsett 2013-11-23 02:25:29 UTC
I added bug 11269 and bug 11183 into their respective see also's, because I believe the second patch in 11183 may solve the same thing this patch does, just at a later point in the code. If so, I believe the second patch to 11183 should be obsoleted. Could someone else check that please?
Comment 6 Fridolin Somers 2014-03-26 11:02:20 UTC
@Galen,
The module MARC::Record should also be fixed no ?
Test if $code_wanted is not undef in subfield().