Bug 27656 - misc/cronjobs/longoverdue.pl better error message
Summary: misc/cronjobs/longoverdue.pl better error message
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-08 14:27 UTC by Fridolin Somers
Modified: 2021-04-25 20:48 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: String patch
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.05,20.05.11


Attachments
Bug 27656: misc/cronjobs/longoverdue.pl better error message (1.57 KB, patch)
2021-02-08 14:41 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 27656: misc/cronjobs/longoverdue.pl better error message (1.62 KB, patch)
2021-04-02 05:29 UTC, David Nind
Details | Diff | Splinter Review
Bug 27656: misc/cronjobs/longoverdue.pl better error message (1.61 KB, patch)
2021-04-16 11:36 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 27656: misc/cronjobs/longoverdue.pl better error message (1.67 KB, patch)
2021-04-16 14:04 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2021-02-08 14:27:12 UTC
There are two ways of configuring misc/cronjobs/longoverdue.pl :
use --lost arg or system preferences DefaultLongOverdueLostValue and DefaultLongOverdueDays.

Actually if you don't use any of it, you get a message :
  "ERROR: No --lost (-l) option defined"
Should also say something about preferences.
Comment 1 Fridolin Somers 2021-02-08 14:41:22 UTC
Created attachment 116510 [details] [review]
Bug 27656: misc/cronjobs/longoverdue.pl better error message

There are two ways of configuring misc/cronjobs/longoverdue.pl :
use --lost arg or system preferencies DefaultLongOverdueLostValue and DefaultLongOverdueDays.

Actually if you don't use any of it, you get a message :
  "ERROR: No --lost (-l) option defined"
Should also say something about preferencies :
  "ERROR: No --lost (-l) option nor system preferencies DefaultLongOverdueLostValue/DefaultLongOverdueDays defined"

Test plan:
1) Set empty preferences DefaultLongOverdueLostValue and DefaultLongOverdueDays
2) Run : misc/cronjobs/longoverdue.pl --maxdays 365
3) You see error message
4) Set DefaultLongOverdueLostValue = 1 and DefaultLongOverdueDays = 90
5) Run : misc/cronjobs/longoverdue.pl --maxdays 365
6) You don't see error message
Comment 2 David Nind 2021-04-02 05:29:08 UTC
Created attachment 119093 [details] [review]
Bug 27656: misc/cronjobs/longoverdue.pl better error message

There are two ways of configuring misc/cronjobs/longoverdue.pl :
use --lost arg or system preferencies DefaultLongOverdueLostValue and DefaultLongOverdueDays.

Actually if you don't use any of it, you get a message :
  "ERROR: No --lost (-l) option defined"
Should also say something about preferencies :
  "ERROR: No --lost (-l) option nor system preferencies DefaultLongOverdueLostValue/DefaultLongOverdueDays defined"

Test plan:
1) Set empty preferences DefaultLongOverdueLostValue and DefaultLongOverdueDays
2) Run : misc/cronjobs/longoverdue.pl --maxdays 365
3) You see error message
4) Set DefaultLongOverdueLostValue = 1 and DefaultLongOverdueDays = 90
5) Run : misc/cronjobs/longoverdue.pl --maxdays 365
6) You don't see error message

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2021-04-02 05:30:46 UTC
A minor suggestion would be to change the error message from:

 ..option nor system preferencies..

to

 ..option or system preferences..
Comment 4 Jonathan Druart 2021-04-14 10:06:43 UTC
Please address David's suggestion.
Comment 5 Fridolin Somers 2021-04-16 11:36:14 UTC
Created attachment 119707 [details] [review]
Bug 27656: misc/cronjobs/longoverdue.pl better error message

There are two ways of configuring misc/cronjobs/longoverdue.pl :
use --lost arg or system preferencies DefaultLongOverdueLostValue and DefaultLongOverdueDays.

Actually if you don't use any of it, you get a message :
  "ERROR: No --lost (-l) option defined"
Should also say something about preferencies :
  "ERROR: No --lost (-l) option no system preferences DefaultLongOverdueLostValue/DefaultLongOverdueDays defined"

Test plan:
1) Set empty preferences DefaultLongOverdueLostValue and DefaultLongOverdueDays
2) Run : misc/cronjobs/longoverdue.pl --maxdays 365
3) You see error message
4) Set DefaultLongOverdueLostValue = 1 and DefaultLongOverdueDays = 90
5) Run : misc/cronjobs/longoverdue.pl --maxdays 365
6) You don't see error message

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 Fridolin Somers 2021-04-16 11:37:30 UTC
(In reply to Jonathan Druart from comment #4)
> Please address David's suggestion.

Sure.
My english is sometimes rusty ;)
Comment 7 Martin Renvoize 2021-04-16 14:04:05 UTC
Created attachment 119744 [details] [review]
Bug 27656: misc/cronjobs/longoverdue.pl better error message

There are two ways of configuring misc/cronjobs/longoverdue.pl :
use --lost arg or system preferencies DefaultLongOverdueLostValue and DefaultLongOverdueDays.

Actually if you don't use any of it, you get a message :
  "ERROR: No --lost (-l) option defined"
Should also say something about preferencies :
  "ERROR: No --lost (-l) option no system preferences DefaultLongOverdueLostValue/DefaultLongOverdueDays defined"

Test plan:
1) Set empty preferences DefaultLongOverdueLostValue and DefaultLongOverdueDays
2) Run : misc/cronjobs/longoverdue.pl --maxdays 365
3) You see error message
4) Set DefaultLongOverdueLostValue = 1 and DefaultLongOverdueDays = 90
5) Run : misc/cronjobs/longoverdue.pl --maxdays 365
6) You don't see error message

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Jonathan Druart 2021-04-16 14:31:17 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 9 Fridolin Somers 2021-04-22 14:35:33 UTC
Pushed to 20.11.x for 20.11.05
Comment 10 Andrew Fuerste-Henry 2021-04-25 16:53:21 UTC
Pushed to 20.05.x for 20.05.11
Comment 11 Victor Grousset/tuxayo 2021-04-25 20:48:52 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.