Bug 8577

Summary: build_holds_queue.pl needs command-line options for help, verbosity, and summary
Product: Koha Reporter: Owen Leonard <oleonard>
Component: Command-line UtilitiesAssignee: Galen Charlton <gmcharlt>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P5 - low CC: magnus
Version: MainKeywords: Academy
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Owen Leonard 2012-08-06 13:35:32 UTC
As per FIXME from 2009:

# FIXME: add command-line options for verbosity and summary
# FIXME: expand perldoc, explain intended logic
# FIXME: refactor all subroutines into C4 for testability

It is not user-friendly to have a command-line script which doesn't accept a --help parameter.
Comment 1 Magnus Enger 2022-01-19 10:12:59 UTC
Looks like the code has been refactored, but there are still two FIXMEs:

# FIXME: add command-line options for verbosity and summary
# FIXME: expand perldoc, explain intended logic
Comment 2 Magnus Enger 2023-10-06 07:06:52 UTC
The script also has this:

my $rthq = C4::Context->preference('RealTimeHoldsQueue');
if ( $rthq && !$force ) {
    say "RealTimeHoldsQueue system preference is enabled, holds queue not built.";
    say "Use --force to force building the holds queue.";
    exit(1);
}

Which means that if a site turns on RealTimeHoldsQueue, the script starts generating "unnecessary" output. Well, if you run the script interactively you might want this output, but not if you run it from a cronjob (which is set up hourly automatically by the Debian packages). So maybe a --quiet option to make the cronjob run without this output?
Comment 3 Katrin Fischer 2023-10-06 21:45:04 UTC
So quiet would be used to suppress the warning, while the holds queue is only rebuilt for instances with RelTimeHoldsQueue off?
Comment 4 Magnus Enger 2023-10-09 06:29:41 UTC
(In reply to Katrin Fischer from comment #3)
> So quiet would be used to suppress the warning, while the holds queue is
> only rebuilt for instances with RelTimeHoldsQueue off?

Yes, that is how I see it.