Bug 23248 - opac-ISBDdetail.pl dies on invalid biblionumber
Summary: opac-ISBDdetail.pl dies on invalid biblionumber
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 22696
Blocks:
  Show dependency treegraph
 
Reported: 2019-07-01 18:51 UTC by Tomás Cohen Arazi
Modified: 2019-07-26 15:50 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.03


Attachments
Bug 23248: Avoid opac-ISBDdetail.pl breaking on invalid biblionumber (926 bytes, patch)
2019-07-01 18:52 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 23248: Avoid opac-ISBDdetail.pl breaking on invalid biblionumber (1.57 KB, patch)
2019-07-01 18:55 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 23248: Avoid opac-ISBDdetail.pl breaking on invalid biblionumber (1.62 KB, patch)
2019-07-04 17:31 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 23248: Avoid opac-ISBDdetail.pl breaking on invalid biblionumber (1.71 KB, patch)
2019-07-05 06:17 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 23248: (QA follow-up) Consolidate 404s (1.52 KB, patch)
2019-07-05 06:17 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2019-07-01 18:51:17 UTC
To reproduce:
- Open your OPAC on a biblio detail page
- Pick the ISBD page
- Alter the biblionumber query param to an obviously non-existent one
=> FAIL: It explodes
Comment 1 Tomás Cohen Arazi 2019-07-01 18:52:31 UTC
Created attachment 91156 [details] [review]
Bug 23248: Avoid opac-ISBDdetail.pl breaking on invalid biblionumber

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi 2019-07-01 18:55:42 UTC
Created attachment 91157 [details] [review]
Bug 23248: Avoid opac-ISBDdetail.pl breaking on invalid biblionumber

This patch makes opac-ISBDdetail.pl redirect to a 404 page (as it
should) in the event of a bad biblionumber passed.

To test:
- Open your browser on a known record detail page (OPAC)
- Switch to the ISBD view
=> SUCCESS: It shows
- Alter the biblionumber on the URL into an obviously non-existent
biblionumber (e.g. very high value)
=> FAIL: Internal errors are shown
- Apply this patch
- Reload the bad biblionumber ISBD view
=> SUCCESS: Browser is redirected to the 404 page as it should
- Sign off :-=> FAIL: Internal errors are shown
- Apply this patch
- Reload the bad biblionumber ISBD view
=> SUCCESS: Browser is redirected to the 404 page as it should
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 M. Tompsett 2019-07-04 17:31:48 UTC
Created attachment 91293 [details] [review]
Bug 23248: Avoid opac-ISBDdetail.pl breaking on invalid biblionumber

This patch makes opac-ISBDdetail.pl redirect to a 404 page (as it
should) in the event of a bad biblionumber passed.

To test:
- Open your browser on a known record detail page (OPAC)
- Switch to the ISBD view
=> SUCCESS: It shows
- Alter the biblionumber on the URL into an obviously non-existent
biblionumber (e.g. very high value)
=> FAIL: Internal errors are shown
- Apply this patch
- Reload the bad biblionumber ISBD view
=> SUCCESS: Browser is redirected to the 404 page as it should
- Sign off :-=> FAIL: Internal errors are shown
- Apply this patch
- Reload the bad biblionumber ISBD view
=> SUCCESS: Browser is redirected to the 404 page as it should
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 4 Marcel de Rooy 2019-07-05 06:17:34 UTC
Created attachment 91311 [details] [review]
Bug 23248: Avoid opac-ISBDdetail.pl breaking on invalid biblionumber

This patch makes opac-ISBDdetail.pl redirect to a 404 page (as it
should) in the event of a bad biblionumber passed.

To test:
- Open your browser on a known record detail page (OPAC)
- Switch to the ISBD view
=> SUCCESS: It shows
- Alter the biblionumber on the URL into an obviously non-existent
biblionumber (e.g. very high value)
=> FAIL: Internal errors are shown
- Apply this patch
- Reload the bad biblionumber ISBD view
=> SUCCESS: Browser is redirected to the 404 page as it should
- Sign off :-=> FAIL: Internal errors are shown
- Apply this patch
- Reload the bad biblionumber ISBD view
=> SUCCESS: Browser is redirected to the 404 page as it should
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Marcel de Rooy 2019-07-05 06:17:38 UTC
Created attachment 91312 [details] [review]
Bug 23248: (QA follow-up) Consolidate 404s

Merging two conditions: biblionumber is empty or biblionumber cannot be
found. This make the strange int($biblionumber) unneeded.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Martin Renvoize 2019-07-05 07:45:46 UTC
Nice work!

Pushed to master for 19.11.00
Comment 7 Fridolin SOMERS 2019-07-25 13:41:42 UTC
Pushed to 19.05.x for 19.05.03
Comment 8 Lucas Gass 2019-07-26 15:50:31 UTC
missing dependencies, wont backport to 18.11.x