Bug 29694 - Add preference for setting marc-record system control number and identifier when saving biblio
Summary: Add preference for setting marc-record system control number and identifier w...
Status: RESOLVED DUPLICATE of bug 27981
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: David Gustafsson
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-14 15:42 UTC by David Gustafsson
Modified: 2022-10-24 21:06 UTC (History)
0 users

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


Attachments
Bug 29694: Add preference for setting 001 and 003 fields on biblio save (4.77 KB, patch)
2021-12-14 16:32 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 29694: Add tests (2.76 KB, patch)
2021-12-14 16:33 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 29694: Add preference for setting 001 and 003 fields on biblio save (4.82 KB, patch)
2021-12-14 16:36 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 29694: Add tests (2.76 KB, patch)
2021-12-14 16:36 UTC, David Gustafsson
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Gustafsson 2021-12-14 15:42:15 UTC
Add a syspref, "AutoAddSystemControlNumberAndMARCOrgCode". If enabled, when a new biblio is saved, the 001 and 003 fields of the marc record will be set to the koha biblionumber and value of the "MARCOrgCode" syspref respectively.

According to the MARC21 standard the old values of 001 and 003 may also be moved to field 035, 010 or 016 as appropriate, but it since this step is more complicated it's perhaps better left to the user to implement some custom solution for this (for example as a to-marc-plugin).
Comment 1 David Gustafsson 2021-12-14 16:32:57 UTC
Created attachment 128517 [details] [review]
Bug 29694: Add preference for setting 001 and 003 fields on biblio save

Add a syspref, "AutoAddSystemControlNumberAndMARCOrgCode". If enabled the
001 and 003 fields of the marc record will be set to the koha biblionumber
and value of the "MARCOrgCode" syspref respectively before when saving
biblios.

To test:
1) Add a new biblio
2) Verify that 001 field is empty
3) Enable AutoAddSystemControlNumberAndMARCOrgCode syspref and make sure
   MARCOrgCode syspref is set to some value
4) Save biblio again
5) Verify that 001 has been set to the Koha biblio and
   003 to the value of MARCOrgCode
6) Run tests in t/db_dependent/Biblio.t
Comment 2 David Gustafsson 2021-12-14 16:33:02 UTC
Created attachment 128518 [details] [review]
Bug 29694: Add tests
Comment 3 David Gustafsson 2021-12-14 16:36:13 UTC
Created attachment 128519 [details] [review]
Bug 29694: Add preference for setting 001 and 003 fields on biblio save

Add a syspref, "AutoAddSystemControlNumberAndMARCOrgCode". If enabled the
001 and 003 fields of the marc record will be set to the koha biblionumber
and value of the "MARCOrgCode" syspref respectively before when saving
biblios.

To test:
1) Add a new biblio
2) Verify that 001 field is empty
3) Enable AutoAddSystemControlNumberAndMARCOrgCode syspref and make sure
   MARCOrgCode syspref is set to some value
4) Save biblio again
5) Verify that 001 has been set to the Koha biblionumber and
   003 to the value of MARCOrgCode
6) Run tests in t/db_dependent/Biblio.t

Sponsored-by: Gothenburg University Library
Comment 4 David Gustafsson 2021-12-14 16:36:17 UTC
Created attachment 128520 [details] [review]
Bug 29694: Add tests
Comment 5 Katrin Fischer 2022-10-24 21:06:04 UTC
Hi David, 

I feel like this is at least a partial duplicate to bug 27981, that was pushed for 22.11. 

003 is set for me to the MarcOrgCode system preference value or to the logged in library's MARCOrgCode on saving. So this seems to work as well.

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