]> git.koha-community.org Git - koha.git/commit
Bug 36891: Restore returning 404 from svc/bib when the bib number doesn't exist
authorPhil Ringnalda <phil@chetcolibrary.org>
Fri, 17 May 2024 00:01:54 +0000 (17:01 -0700)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 19 Jul 2024 09:31:30 +0000 (11:31 +0200)
commitb87c8728803cd642b24b215525d9cb196eaf4c27
tree6869e6d6f0c9604b4eb6262beb26a1dab892668a
parenta54a1a2e2f31204fc7f3d464848268ca909fd0dd
Bug 36891: Restore returning 404 from svc/bib when the bib number doesn't exist

Changing from GetMarcBiblio to Biblios->find plus metadata->record lost the
way that svc/bib used to return 404 when the bib number wasn't found. This
patch restores that by checking for undef after the Biblios->find step.

Test plan:
1. Load e.g. http://127.0.0.1:8081/cgi-bin/koha/svc/bib/289 which returns an
   XML bib record
2. Load http://127.0.0.1:8081/cgi-bin/koha/svc/bib/99999999 and get a 500 error
2. Appply patch, restart_all
4. Reload http://127.0.0.1:8081/cgi-bin/koha/svc/bib/289 and get the bib again
5. Reload http://127.0.0.1:8081/cgi-bin/koha/svc/bib/99999999 and get a 404

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 3d1b38b0ade54dae8d565e2195e2e97f4826a0b6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit d3383fed5cb0e23dbcf4bab5422940ab8b0770a7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
svc/bib