Bug 23248

Summary: opac-ISBDdetail.pl dies on invalid biblionumber
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: OPACAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, lucas, m.de.rooy, martin.renvoize, mtompset
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.03
Bug Depends on: 22696    
Bug Blocks:    
Attachments: Bug 23248: Avoid opac-ISBDdetail.pl breaking on invalid biblionumber
Bug 23248: Avoid opac-ISBDdetail.pl breaking on invalid biblionumber
Bug 23248: Avoid opac-ISBDdetail.pl breaking on invalid biblionumber
Bug 23248: Avoid opac-ISBDdetail.pl breaking on invalid biblionumber
Bug 23248: (QA follow-up) Consolidate 404s

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 Mark 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