Bug 30812 - subfield 9 deleted if no other data is available
Summary: subfield 9 deleted if no other data is available
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: 21.05
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-19 14:01 UTC by Thomas Klausner
Modified: 2022-11-17 12:42 UTC (History)
3 users (show)

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


Attachments
A valuebuilder workaround (905 bytes, application/x-perl)
2022-08-12 09:12 UTC, Thomas Klausner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Klausner 2022-05-19 14:01:32 UTC
DNB exports the ISBN with dashes in 020$9, which we import via SRU while cataloguing.

Therefore we added a subfield 9 to field 020.

But when 020 contains no data except the dashed ISBN in $9, the value of $9 is deleted.

I assume this is caused by some special cases needed to delete the koha_id of an authority (which is often stored in $9).

To reproduce:

* Go to a framwork, field 020, add a subfield 9, visible in tab 0, OPAC, Intranet and edito
* Go to a book, edit it, enter something in 020$a and 020$9, save
* The values are stored
* Edit again, remove the value from 020$a, save
* the value from 020$9 is gone, too

I can maybe take a look tomorrow to try to figure out what's happening..
Comment 1 Thomas Klausner 2022-08-12 09:12:12 UTC
Created attachment 139043 [details]
A valuebuilder workaround

Here is a valuebuilder that works around that problem by autofilling 020$a with ISNB without dashes after a value is entered into 020$9 (ISBN with dashes)

Not optimal, but better than loosing data...

Copy the file into `intranet/cgi-bin/cataloguing/value_builder` and enable it as a plugin to 020 subfiled 9.
Comment 2 Katrin Fischer 2022-11-17 12:42:22 UTC
I am wondering - doesn't the DNB also deliver 020$a without hyphens in addition to $9? At least that is the case for K10plus.