Bug 28584 - Remove hyphens from EAN when adding a new record
Summary: Remove hyphens from EAN when adding a new record
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Emmi Takkinen
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-17 11:20 UTC by Emmi Takkinen
Modified: 2022-03-27 12:51 UTC (History)
3 users (show)

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


Attachments
Bug 28584: Remove hyphens from EAN when adding new record (3.17 KB, patch)
2021-06-17 11:22 UTC, Emmi Takkinen
Details | Diff | Splinter Review
Bug 28584: Remove hyphens from EAN when adding new record (3.31 KB, patch)
2022-02-04 11:16 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 28584: Remove hyphens from EAN when adding new record (3.36 KB, patch)
2022-02-16 15:21 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Emmi Takkinen 2021-06-17 11:20:33 UTC
In Finland we use EANs to match records. Occassionaly we get double records if record is saved with hyphens in EAN and same record already exists without them or vice versa. To prevent this hyphens should always be removed from EAN in Koha level when record is saved (similary like has been suggested in bug 27774 to ISBN).
Comment 1 Emmi Takkinen 2021-06-17 11:22:31 UTC Comment hidden (obsolete)
Comment 2 Magnus Enger 2021-06-17 11:25:39 UTC
But see the discussion on bug 6590. The conclusion there was to not remove the hyphens, I think.
Comment 3 Emmi Takkinen 2021-06-17 11:30:25 UTC
(In reply to Magnus Enger from comment #2)
> But see the discussion on bug 6590. The conclusion there was to not remove
> the hyphens, I think.

I understood it only applied to ISBN and ISSN. Also from that bug comment 15 says:

> 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.
Comment 4 Kyle M Hall 2022-02-04 11:16:31 UTC
Created attachment 130159 [details] [review]
Bug 28584: Remove hyphens from EAN when adding new record

Add functionality to TransformMarcToKoha so that hyphens
are removed from biblioitem tables "ean" column but EAN
value in MARC record is not touched.

To test:

1. Apply patch.
2. Create new record with EAN field(s) having hyphen(s) e.g. 74628-8972
3. Check records MARC details
=> EAN has hyphen
4. Check record from biblioitem table in database
=> EAN doesn't have hyphen(s)

Prove t/db_dependent/Biblio/TransfornMarcToKoha.t

Sponsored-by: Koha-Suomi Oy

Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Comment 5 Emmanuel Bétemps 2022-02-08 08:29:55 UTC
I'm sorry but I tested once again today and it doesn't work.

The first test I did was on February the 4th, at noon.
- when I ran the sandbox, Kyle M Hall's comment wasn't here
- when I signed-off, I saw his comment

I don't know what patch I used for my first test.
Comment 6 Emmi Takkinen 2022-02-08 09:42:17 UTC
(In reply to e.betemps from comment #5)
> I'm sorry but I tested once again today and it doesn't work.
Could you describe in more detail how this doesn't work? Tested this on my test environment, hyphens are removed from biblioitems but not from MARC and test pass. So in my end, everything works as expected.

> The first test I did was on February the 4th, at noon.
> - when I ran the sandbox, Kyle M Hall's comment wasn't here
> - when I signed-off, I saw his comment
> 
> I don't know what patch I used for my first test.
You probably used first patch provided here (id 122059, one without sign-off), but it seems Kyle somehow hijacked your sign-off :D I'm unsure how sandbox testing works, so no idea how this is possible.
Comment 7 Emmanuel Bétemps 2022-02-15 08:17:05 UTC
I followed the test plan : create a notice with values (with hyphen) in 073a

I see the hyphen in the Mark preview (it's ok) but I also see it in my report (which displays the column 'ean' of the table 'biblioitems')
Comment 8 Owen Leonard 2022-02-16 15:21:30 UTC
Created attachment 130670 [details] [review]
Bug 28584: Remove hyphens from EAN when adding new record

Add functionality to TransformMarcToKoha so that hyphens
are removed from biblioitem tables "ean" column but EAN
value in MARC record is not touched.

To test:

1. Apply patch.
2. Create new record with EAN field(s) having hyphen(s) e.g. 74628-8972
3. Check records MARC details
=> EAN has hyphen
4. Check record from biblioitem table in database
=> EAN doesn't have hyphen(s)

Prove t/db_dependent/Biblio/TransfornMarcToKoha.t

Sponsored-by: Koha-Suomi Oy

Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 9 Owen Leonard 2022-02-16 15:23:27 UTC
I had to update Koha to MARC mapping because I didn't have biblioitems.ean mapped to anything. After setting it to 024$a and running batchRebuildBiblioTables.pl it worked as per the test plan.
Comment 10 Katrin Fischer 2022-03-27 12:51:48 UTC
Hi Emmi,

you said you use the EAN for matching so I wonder if removing the hyphen from the database column, but not from the MARC record will work? Could you explain your use case a little more?

Right now this patch makes me a little uneasy as I feel like the information in the database and in the MARC record should match and this is an automatism that the library won't be able to control.

In MARC21 024 is used to store EAN, but also a lot of other identifiers depending on indicator and $2:

024 - Other Standard Identifier (R)
https://www.loc.gov/marc/bibliographic/bd024.html

0 - International Standard Recording Code
1 - Universal Product Code
2 - International Standard Music Number
3 - International Article Number
4 - Serial Item and Contribution Identifier
7 - Source specified in subfield $2

Source of the number or code is specified in subfield $2 (Source of number or code).
8 - Unspecified type of standard number or code

So by doing this silently, we'll also be doing it for all of those numbers, some of which we can't tell what they might be ($2)