Summary: | GuessAuthTypeCode should check authority type exists | ||
---|---|---|---|
Product: | Koha | Reporter: | Fridolin Somers <fridolin.somers> |
Component: | Cataloging | Assignee: | Fridolin Somers <fridolin.somers> |
Status: | Failed QA --- | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | jonathan.druart, m.de.rooy |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
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 23380: GuessAuthTypeCode should check authority type exists
Bug 23380: GuessAuthTypeCode should check authority type exists |
Description
Fridolin Somers
2019-07-26 10:00:14 UTC
Created attachment 91797 [details] [review] Bug 23380: GuessAuthTypeCode should check authority type exists The method GuessAuthTypeCode is used when importing from batch or z3950/SRU to find the local authority type depending on MARC flavour and authority record fields. This method should check that found type is configured. Otherwise it can generate software errors when type code is used to fetch Koha::Authority::Type. Test plan : 1) Delete an authority type, ie NP 2) Connect to a z3950/SRU authority server 3) Look for authorities of this type 4) Import an authority 5) Without patch you get error : Can't call method "auth_tag_to_report" on an undefined value at /home/koha/src/C4/AuthoritiesMarc.pm line 757. 6) With patch you see record edition and in logs "Authority type NP not configured" Please cover subroutines changes by tests. Created attachment 145703 [details] [review] Bug 23380: GuessAuthTypeCode should check authority type exists The method GuessAuthTypeCode is used when importing from batch or z3950/SRU to find the local authority type depending on MARC flavour and authority record fields. This method should check that found type is configured. Otherwise it can generate software errors when type code is used to fetch Koha::Authority::Type. Test plan : 1) Delete an authority type, ie NP 2) Connect to a z3950/SRU authority server 3) Look for authorities of this type 4) Import an authority 5) Without patch you get error : Can't call method "auth_tag_to_report" on an undefined value at /home/koha/src/C4/AuthoritiesMarc.pm line 757. 6) With patch you see record edition and in logs "Authority type NP not configured" Fixed for current master. Using Koha::Authority::Types->search->get_column('authtypecode') is better. (In reply to Fridolin Somers from comment #4) > Fixed for current master. > > Using Koha::Authority::Types->search->get_column('authtypecode') is better. Which means? Do we close this one? (In reply to Jonathan Druart from comment #5) > (In reply to Fridolin Somers from comment #4) > > Fixed for current master. > > > > Using Koha::Authority::Types->search->get_column('authtypecode') is better. > > Which means? Do we close this one? No I mean rebased on current master and patch slightly changed |