Bug 36351: Adjust saveRecord and _fromXMLStruct
authorNick Clemens <nick@bywatersolutions.com>
Tue, 19 Mar 2024 15:33:28 +0000 (15:33 +0000)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Wed, 20 Mar 2024 17:39:43 +0000 (18:39 +0100)
commit99911f462a0ce77e6833b396e2283c4a381213f7
treed09723842e24408f116c7f7b40fc4997601fa4bd
parent73179f9b04030d88e8cf1dd7c5eca210bcc52b50
Bug 36351: Adjust saveRecord and _fromXMLStruct

Using the new API Client means we need to handle some calls differently.
the http-client is returning only the response, not the text, so we need to handle getting this out
with a new async function (or promises, but this works)

We also need to adjust _fromXMLStruct as we have reduced the levels in the response by the time it is called

This now adds a new 'update' function to the cataloguing client as well.

Eventually, this should all be using the REST API, but I think for now handling the non-standard responses gets it
working again

To test:
To test:
1 - Browse to Cataloguing->Advanced editor
2 - New Record
3 - Enter values and save - confirm it works
4 - Confirm url now ends in : editor.pl#catalog/{biblionumber} and not editor.pl#new
5 - Save the record again, confirm biblio is updated and not saved as new

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js
koha-tmpl/intranet-tmpl/prog/js/fetch/cataloguing-api-client.js