Bug 27774

Summary: Always remove hyphens from ISBN when cataloging
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: CatalogingAssignee: Fridolin Somers <fridolin.somers>
Status: RESOLVED DUPLICATE QA Contact: Kyle M Hall (khall) <kyle>
Severity: minor    
Priority: P5 - low CC: dcook, jonathan.druart, kyle, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6590
GIT URL: 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 27774: Always remove hyphens from ISBN when cataloging
Bug 27774: Always remove hyphens from ISBN when cataloging
Bug 27774: Always remove hyphens from ISBN when cataloging
Bug 27774: Add unit test
Bug 27774: Add unit test

Description Fridolin Somers 2021-02-24 15:28:44 UTC
Actually hyphens are removed from ISBN when using acquisition or z3950 cataloguing or with bulkmarcimport.
I propose to add this behavior in TransformMarcToKoha() so MARC data is unchanged, but biblioitems.isbn is without hyphens. This can be used if search using SQL and in reports.
Comment 1 Fridolin Somers 2021-02-24 15:29:35 UTC
Sort of a renew of Bug 6590
Comment 2 Fridolin Somers 2021-02-24 15:49:36 UTC
Created attachment 117277 [details] [review]
Bug 27774: Always remove hyphens from ISBN when cataloging

Actually hyphens are removed from ISBN when using acquisition or z3950 cataloguing or with bulkmarcimport.
I propose to add this behavior in TransformMarcToKoha() so MARC data is unchanged, but biblioitems.isbn is without hyphens. This can be used if search using SQL and in reports.

We may after this remove other codes that remove hyphens before
cataloguing a biblio record.

Test plan :
1) Create a new record with an ISBN with hyphen, ie 978-0008376109
2) Save
3) Export to MARCXML and see ISBN has hyphen
4) Look into database : select isbn from biblioitems where
   bilionumber=xxx
5) Check you see ISBN without hyphen
Comment 3 Frank Hansen 2021-02-25 14:31:04 UTC
Created attachment 117329 [details] [review]
Bug 27774: Always remove hyphens from ISBN when cataloging

Actually hyphens are removed from ISBN when using acquisition or z3950 cataloguing or with bulkmarcimport.
I propose to add this behavior in TransformMarcToKoha() so MARC data is unchanged, but biblioitems.isbn is without hyphens. This can be used if search using SQL and in reports.

We may after this remove other codes that remove hyphens before
cataloguing a biblio record.

Test plan :
1) Create a new record with an ISBN with hyphen, ie 978-0008376109
2) Save
3) Export to MARCXML and see ISBN has hyphen
4) Look into database : select isbn from biblioitems where
   bilionumber=xxx
5) Check you see ISBN without hyphen

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Comment 4 Kyle M Hall (khall) 2021-04-09 16:10:12 UTC
Created attachment 119413 [details] [review]
Bug 27774: Always remove hyphens from ISBN when cataloging

Actually hyphens are removed from ISBN when using acquisition or z3950 cataloguing or with bulkmarcimport.
I propose to add this behavior in TransformMarcToKoha() so MARC data is unchanged, but biblioitems.isbn is without hyphens. This can be used if search using SQL and in reports.

We may after this remove other codes that remove hyphens before
cataloguing a biblio record.

Test plan :
1) Create a new record with an ISBN with hyphen, ie 978-0008376109
2) Save
3) Export to MARCXML and see ISBN has hyphen
4) Look into database : select isbn from biblioitems where
   bilionumber=xxx
5) Check you see ISBN without hyphen

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Kyle M Hall (khall) 2021-04-09 16:10:24 UTC
Created attachment 119414 [details] [review]
Bug 27774: Add unit test

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Jonathan Druart 2021-04-12 11:52:42 UTC
Created attachment 119452 [details] [review]
Bug 27774: Add unit test

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

JD amended patch: s/all three mappings/all mappings/
Comment 7 Jonathan Druart 2021-04-12 12:44:30 UTC
From bug 6590 it seems that people didn't agree on removing hyphens for ISBNs

Bug 6590 comment 15:
> In UNIMARC, ISBN field is supposed to contain ISBN as written on the
> book cover. ISBN without hyphens can be stored in EAN (073) field.

Why did you open a separate bug report?
Comment 8 Fridolin Somers 2021-04-12 12:54:32 UTC
Piouf I don't remember.
I'm OK if this one is closed as duplicate.
Comment 9 Katrin Fischer 2021-06-03 21:14:58 UTC

*** This bug has been marked as a duplicate of bug 6590 ***