Because of an uncaught exception, both catalogue/image.pl and opac/opac-image.pl return 500 errors when asked to provide the image by biblionumber for a bib that does not exist. This is a bit untidy; if the bib does not exist, *image.pl should either return the default one-pixel image or perhaps a 404, but not the error page. This normally isn't a huge deal when the local cover images are displayed by the staff or public catalog, as both of those interfaces inherently only display bibs that are known to exist. However, since it is possible for external clients to want to get at local cover images (e.g., see https://github.com/vufind-org/vufind/pull/2444), better provision should be made if the client requests the local cover of a nonexisting bib (e.g., if the bib had been deleted since the last time that the external client got knowledge of it).
Created attachment 151082 [details] [review] Bug 33047: Return 404 instead of 500 when biblio does not exist If the biblionumber or the itemnumber passed in parameter does not exist we should return 404 instead of exploding with a 500. Test plan: Attach cover images to biblio and items Notice that the UI is working correctly (staff and OPAC) Hit catalogue/image.pl and opac/opac-image.pl with non-existent biblionumber and imagenumber Notice that you now get 404 instead of 500
Galen, would that work for you?
Created attachment 152390 [details] [review] Bug 33047: Return 404 instead of 500 when biblio does not exist If the biblionumber or the itemnumber passed in parameter does not exist we should return 404 instead of exploding with a 500. Test plan: Attach cover images to biblio and items Notice that the UI is working correctly (staff and OPAC) Hit catalogue/image.pl and opac/opac-image.pl with non-existent biblionumber and imagenumber Notice that you now get 404 instead of 500 Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 153226 [details] [review] Bug 33047: Return 404 instead of 500 when biblio does not exist If the biblionumber or the itemnumber passed in parameter does not exist we should return 404 instead of exploding with a 500. Test plan: Attach cover images to biblio and items Notice that the UI is working correctly (staff and OPAC) Hit catalogue/image.pl and opac/opac-image.pl with non-existent biblionumber and imagenumber Notice that you now get 404 instead of 500 Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 23.11. Nice work everyone, thanks!
Thanks for all the hard work! Pushed to 23.05.x for the next release
Nice work everyone! Pushed to oldstable for 22.11.x