Bugzilla – Attachment 152436 Details for
Bug 33036
Add route to merge bibliographic records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33036: REST API: Merge biblio records implements merging of records + attached items, subscriptions etc via the API as an alternative to the web interface: cgi-bin/koha/cataloguing/merge.pl
Bug-33036-REST-API-Merge-biblio-records-implements.patch (text/plain), 2.59 KB, created by
Mark Hofstetter
on 2023-06-16 16:33:43 UTC
(
hide
)
Description:
Bug 33036: REST API: Merge biblio records implements merging of records + attached items, subscriptions etc via the API as an alternative to the web interface: cgi-bin/koha/cataloguing/merge.pl
Filename:
MIME Type:
Creator:
Mark Hofstetter
Created:
2023-06-16 16:33:43 UTC
Size:
2.59 KB
patch
obsolete
>From 700a0ab275ec9c02d54a46d33aaa6d364635ba44 Mon Sep 17 00:00:00 2001 >From: Mark Hofstetter <mark@hofstetter.at> >Date: Fri, 16 Jun 2023 17:21:33 +0200 >Subject: [PATCH] Bug 33036: REST API: Merge biblio records implements merging > of records + attached items, subscriptions etc via the API as an alternative > to the web interface: cgi-bin/koha/cataloguing/merge.pl > >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) execute API calls eg like > PUT /biblios/{biblio_id}/merge/{biblio_id_to_merge} > eg: > curl -s -u koha:koha -X PUT "http://127.0.0.1:8081/api/v1/biblios/262/merge/9" >6) the record with the id <biblio_id_to_merge> is deleted now, the record with <biblio_id> > has all items, etc attached, return code is 200, with the message {"message":"Successfuly merged 9 into 262"} >7) optionally a full MARCXML record may be sent as body of the API call > curl -s -u koha:koha -X PUT "http://127.0.0.1:8081/api/v1/biblios/262/merge/2" -d @marcfile.xml >8) now also the content of the record with <biblio_id> is replaced with the content of the MARCXML file >9) Sign off. >10) Thx > >Sponsored-by: Technische Hochschule Wildau >Co-authored-by: domm@plix.at >--- > Koha/REST/V1/Biblios.pm | 2 +- > api/v1/swagger/paths/biblios_merge.yaml | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm >index 41b0268034..966f25c270 100644 >--- a/Koha/REST/V1/Biblios.pm >+++ b/Koha/REST/V1/Biblios.pm >@@ -947,7 +947,7 @@ sub merge { > $c->render( status => 400, json => {error => $error}); > } > >- return $c->render( status => 200, openapi => { message => sprintf("Successfuly merged %s into %s", >+ return $c->render( status => 200, openapi => { message => sprintf("Successfully merged %s into %s", > $bn_merge, $ref_biblionumber) > }); > } catch { >diff --git a/api/v1/swagger/paths/biblios_merge.yaml b/api/v1/swagger/paths/biblios_merge.yaml >index 2b947a042f..4714be1532 100644 >--- a/api/v1/swagger/paths/biblios_merge.yaml >+++ b/api/v1/swagger/paths/biblios_merge.yaml >@@ -48,4 +48,4 @@ > "$ref": "../swagger.yaml#/definitions/error" > x-koha-authorization: > permissions: >- catalogue: "manage_item_groups" >+ catalogue: "editcatalogue" >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33036
:
152436
|
152437
|
152438
|
152439
|
152440
|
152447
|
152472
|
152659
|
152678
|
157481
|
157482
|
157731
|
159011
|
159012
|
159103
|
159120
|
159191
|
159239
|
159826
|
159827
|
159828
|
159829
|
160302
|
160468
|
160469
|
160470
|
160471
|
160472