Bug 20927 - moredetail.pl crash on nonexistent biblionumber
Summary: moredetail.pl crash on nonexistent biblionumber
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: 18.05
Hardware: All All
: P5 - low minor
Assignee: paxed
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-13 04:45 UTC by paxed
Modified: 2019-10-14 19:58 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 20927: moredetail.pl crash on nonexistent biblionumber (3.25 KB, patch)
2018-06-13 04:50 UTC, paxed
Details | Diff | Splinter Review
Bug 20927: moredetail.pl crash on nonexistent biblionumber (3.29 KB, patch)
2018-06-22 19:33 UTC, Maryse Simard
Details | Diff | Splinter Review
[17.11.x] Bug 20927: moredetail.pl crash on nonexistent biblionumber (3.39 KB, patch)
2018-07-06 05:55 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 20927: Shortcut moredetail.pl on nonexistent biblionumber (793 bytes, patch)
2018-07-11 16:36 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2018-06-13 04:45:18 UTC
moredetail.pl crashes when trying to view a nonexistent biblionumber.

The case should be handled like it is done in detail.pl.
Comment 1 paxed 2018-06-13 04:50:30 UTC Comment hidden (obsolete)
Comment 2 Maryse Simard 2018-06-22 19:33:35 UTC
Created attachment 76305 [details] [review]
Bug 20927: moredetail.pl crash on nonexistent biblionumber

moredetail.pl crashes when trying to view a nonexistent biblionumber.

The case should be handled like it is done in detail.pl.

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Comment 3 Jonathan Druart 2018-06-25 17:05:35 UTC
I would recommend to use output_and_exit_if_error (introduced by bug 18043).

You can find examples on bug 20661 and bug 20351.

I was waiting for these patches to get attention before continuing in this direction (and so apply the method to other modules).
Comment 4 Marcel de Rooy 2018-07-06 05:55:28 UTC
Created attachment 76713 [details] [review]
[17.11.x] Bug 20927: moredetail.pl crash on nonexistent biblionumber

moredetail.pl crashes when trying to view a nonexistent biblionumber.

The case should be handled like it is done in detail.pl.

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Marcel de Rooy 2018-07-06 05:59:31 UTC
(In reply to Jonathan Druart from comment #3)
> I would recommend to use output_and_exit_if_error (introduced by bug 18043).
> 
> You can find examples on bug 20661 and bug 20351.
> 
> I was waiting for these patches to get attention before continuing in this
> direction (and so apply the method to other modules).

Solution is identical in detail.
I saw output_and_exit_if_error somewhere recently and was not really impressed.
Comment 6 Jonathan Druart 2018-07-11 14:16:39 UTC
Ok I will provide a patch then.
Comment 7 Jonathan Druart 2018-07-11 16:36:31 UTC
Created attachment 76865 [details] [review]
Bug 20927: Shortcut moredetail.pl on nonexistent biblionumber
Comment 8 Jonathan Druart 2018-07-11 16:38:23 UTC
(In reply to Marcel de Rooy from comment #5)
> Solution is identical in detail.
> I saw output_and_exit_if_error somewhere recently and was not really
> impressed.

Identical but much more changes are needed.

See this counter-patch (to apply on top of bug 20661) and you will get why it's better ;)
Comment 9 paxed 2018-07-23 04:24:11 UTC
Jonathan's counter-patch is better for more recent versions, obviously, but we're currently running off of 17.05, where output_and_exit doesn't exist, and I didn't even know about it.
Comment 10 Marcel de Rooy 2018-07-27 05:42:15 UTC
Moving counterpatch to 21125 and marking the original patch for 17.11.x
Comment 11 Marcel de Rooy 2018-07-27 05:54:01 UTC
RMaints: Please note that this could be pushed to 18.05 but since 18.05 includes output_and_exit_if_error, it could be done more like 21125 which is only for master ;)
Comment 12 Marcel de Rooy 2018-07-27 05:57:46 UTC
It applies to 18.05; so I will just mark it as 18.05. If someone wants to provide a 18.05 specific counterpatch, you are welcome :)
Comment 13 Martin Renvoize (ashimema) 2018-08-14 15:24:32 UTC
Bug 21125 and Bug 20661 have both been pushed to 18.05.x for 18.05.03 release.