[Koha-bugs] [Bug 32332] New: bulkmarcimport.pl -insert fails to add MARC field 999

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Nov 23 10:56:00 CET 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32332

            Bug ID: 32332
           Summary: bulkmarcimport.pl -insert fails to add MARC field 999
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Command-line Utilities
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: magnus at libriotech.no
        QA Contact: testopia at bugs.koha-community.org
                CC: robin at catalyst.net.nz

We have several libraries that have problems with their batch imports/updates
from external sources after upgrading to 22.05.06. The problem is that records
that are imported and/or updated via bulkmarcimport.pl do not get a 999 field,
with the biblionumber in $c and $d. No 999 field is added at all. 

To reproduce in koha-testing-docker:

- Edit koha/t/db_dependent/Record/testrecords/marcxml_utf8.xml and remove the
952 field (otherwise Koha will complain about an undefined branchcode)

- Import that file: 
$ sudo koha-shell -c "perl koha/misc/migration_tools/bulkmarcimport.pl -b -v
-m=MARCXML -match=Control-number,001 -insert -l=/tmp/import.log -file
koha/t/db_dependent/Record/testrecords/marcxml_utf8.xml" kohadev

- Check the result: 
$ sudo koha-mysql kohadev
MariaDB [koha_kohadev]> SELECT biblionumber, ExtractValue(metadata,
'count(//datafield[@tag="999"])') AS count999 FROM biblio_metadata HAVING
count999 = 0;

This should give output like this: 

+--------------+----------+
| biblionumber | count999 |
+--------------+----------+
|          439 | 0        |
+--------------+----------+
1 row in set (0.013 sec)

...meaning biblionumber 439 does not have a 999 field. 

- Updating the same record: 
$ sudo koha-shell -c "perl koha/misc/migration_tools/bulkmarcimport.pl -b -v
-m=MARCXML -match=Control-number,001 -update -l=/tmp/import.log -file
koha/t/db_dependent/Record/testrecords/marcxml_utf8.xml" kohadev

...seems to add the 999 and make the problem go away: 
$ sudo koha-mysql kohadev
MariaDB [koha_kohadev]> SELECT biblionumber, ExtractValue(metadata,
'count(//datafield[@tag="999"])') AS count999 FROM biblio_metadata HAVING
count999 = 0;
Empty set (0.009 sec)

BUT on live servers (running 22.05.06, not master like in ktd) it looks like
updating a record via bulkmarcimport.pl can cause an existing record to loose
its 999 field.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list