Bug 27656: misc/cronjobs/longoverdue.pl better error message
authorFridolin Somers <fridolin.somers@biblibre.com>
Mon, 8 Feb 2021 14:28:35 +0000 (15:28 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 22 Apr 2021 14:34:59 +0000 (16:34 +0200)
commite7c3e5f81b159d100dd40a729d704a1f59a6426e
tree812d48802b542a99dbfa715629275a634e08c2a5
parentcefb8bcf0c58ca31f48b45a693c831a1bf28d0bf
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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 891145130c1fd4f216026eeb94c37300c8e3fd01)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
misc/cronjobs/longoverdue.pl