[Bug 36613] New: Wrong return statuses on merge biblio feature
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36613 Bug ID: 36613 Summary: Wrong return statuses on merge biblio feature Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com CC: tomascohen@gmail.com Bug 33036 introduced a feature for merging records using the API. But some of the return statuses are wrong: ```perl if ( ( $rules eq 'override_ext' ) && ( $override_rec eq '' ) ) { return $c->render( status => 404, json => { error => "With the rule 'override_ext' you need to insert a bib record in marc-in-json format into 'record' field." } ); } if ( ( $rules eq 'override' ) && ( $framework ne '' ) ) { return $c->render( status => 404, json => { error => "With the rule 'override' you can not use the field 'framework_to_use'." } ); } ``` Both should be '400 - Bad request' -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36613 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |33036 Keywords| |rel_24_05_candidate Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33036 [Bug 33036] REST API: Merge biblio records -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36613 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Wrong return statuses on |Tidy merge biblio feature |merge biblio feature | --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- There are also a few things to consider: * Creating a 'merge' resource should return a 201. * The use of `respond_to` doesn't look correct. You either always return mij, or have some fallback mechanism. I tried tweaking the tests so they pass application/marc and even though the operation succeeded, I got an empty reply and a 204 instead of a 200!: ``` # Failed test '200 OK' # at t/db_dependent/api/v1/biblios.t line 2155. # got: '204' # expected: '200' # Failed test 'Update with Marc-in-json record' # at t/db_dependent/api/v1/biblios.t line 2159. # '' # doesn't match '(?^u:Using mij)' # Looks like you failed 2 tests of 12. ``` so not a failure, or an explosion, just a weird behavior! * the `catch` block is returning a 400 instead of a 500 (unhandled server error). I assume there were reasons to return a 400. I think they should be individually handled properly, and then fallback to 500. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36613 Bug 36613 depends on bug 33036, which changed state. Bug 33036 Summary: Add route to merge bibliographic records https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33036 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36613 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_24_05_candidate | CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org