[Koha-bugs] [Bug 33036] REST API: Merge biblio records
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Wed Nov 15 22:05:39 CET 2023
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33036
Zeno Tajoli <ztajoli at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|Failed QA |Needs Signoff
--- Comment #31 from Zeno Tajoli <ztajoli at gmail.com> ---
A new version that follow the requests given.
To test:
1) you need an API user with the permissions "editcatalogue"
2) two records: one to be merged into (with biblio_id, eg 262) and another
one from which to merge (with biblio_id_to_merge, eg 9) which will be
deleted! both records may/should have items, subscription,
subscriptionhistory, serial, suggestions, orders and holds
3) check both records via the web
4) Apply patch
5) Write a JSON file with inside the field 'biblio_id_to_merge' and the
biblionumber from wihich to merge.
As example:
{
"biblio_id_to_merge" : 9
}
6) Execute an API call with correct headers and location. For example:
curl -s -u koha:koha --header "Content-Type: application/json" --header
"Accept: application/marc-in-json" --request POST
"http://127.0.0.1:8080/api/v1/biblios/262/merge" -d @file.json
You must to setup the headers and to use a json file with parameters
7) The record with the id 9 is deleted now, the record with 262 has all
items, etc attached, the return is: return code 200 and the changed
record 262 in marc-in-json format
8) It is possible to override biblio data with an external bib record. You
need to put external bib record into the json file in marc-in-json
format. To write use the json file uploaded as example
You need to fill the fields 'rules' and 'datarecord'. The field 'rules'
must contains 'override_ext'
To do the call:
curl -s -u koha:koha --header "Content-Type: application/json"
--header
"Accept: application/marc-in-json" --request POST
"http://127.0.0.1:8080/api/v1/biblios/XXX/merge" -d @file_with_recod.json
9) The record in 'biblio_id_to_merge' is deleted now, in biblio XXX now
there are the bibliographic data of field 'datarecord' of json file,
the return is: return code 200 and the changed record XXX in
marc-in-json format
10) Go into intranet and do a search. Select two or (better) more record.
11) Merge them; merge must be a success.
12) Test with prove -v t/db_dependent/Koha/Biblio.t
13) Test with prove -v t/db_dependent/api/v1/biblios.t
To test with curl the step 8 you can customize the json file attached in
bugzilla.
The marc-in-json record inside follows the MAR21 standard
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list