Bug 29078 - Division by zero in touch_all scripts
Summary: Division by zero in touch_all scripts
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-22 14:05 UTC by Marcel de Rooy
Modified: 2022-06-06 20:24 UTC (History)
5 users (show)

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


Attachments
Bug 29078: Resolve division by zero in touch_all scripts (1.99 KB, patch)
2021-09-22 14:11 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 29078: Resolve division by zero in touch_all scripts (2.02 KB, patch)
2021-09-24 15:29 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2021-09-22 14:05:59 UTC
The touch_all scripts allow you to specify a where condition. If you have no records in the set, the result is divided by zero to get a percentage.
Comment 1 Marcel de Rooy 2021-09-22 14:11:14 UTC
Created attachment 125133 [details] [review]
Bug 29078: Resolve division by zero in touch_all scripts

Illegal division by zero at misc/maintenance/touch_all_biblios.pl line 102.

Trivial fix.
Funny that the percentage is not even shown without verbose flag ;)

Test plan:
Run misc/maintenance/touch_all_biblios.pl -where 'biblionumber<0'
You should now see:
Good: 0, Bad: 0 (of 0) in 0 seconds

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2021-09-22 14:11:37 UTC
Super trivial, self signoff
Comment 3 Martin Renvoize (ashimema) 2021-09-24 15:29:37 UTC
Created attachment 125275 [details] [review]
Bug 29078: Resolve division by zero in touch_all scripts

Illegal division by zero at misc/maintenance/touch_all_biblios.pl line 102.

Trivial fix.
Funny that the percentage is not even shown without verbose flag ;)

Test plan:
Run misc/maintenance/touch_all_biblios.pl -where 'biblionumber<0'
You should now see:
Good: 0, Bad: 0 (of 0) in 0 seconds

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize (ashimema) 2021-09-24 15:30:00 UTC
All works as expected.. PQA
Comment 5 Jonathan Druart 2021-09-28 13:40:16 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 6 Kyle M Hall (khall) 2021-10-08 13:22:14 UTC
Pushed to 21.05.x for 21.05.05
Comment 7 Fridolin Somers 2021-10-21 03:47:49 UTC
Pushed to 20.11.x for 20.11.11
Comment 8 Victor Grousset/tuxayo 2021-10-26 00:38:09 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.