Bugzilla – Attachment 92114 Details for
Bug 16219
Runreport.pl should allow SQL parameters to be passed on the command line
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16219: (follow-up) Nicer message if params missing and note that they are not combined
Bug-16219-follow-up-Nicer-message-if-params-missin.patch (text/plain), 1.95 KB, created by
Marcel de Rooy
on 2019-08-09 10:22:36 UTC
(
hide
)
Description:
Bug 16219: (follow-up) Nicer message if params missing and note that they are not combined
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2019-08-09 10:22:36 UTC
Size:
1.95 KB
patch
obsolete
>From b427dbfd9cc2771b0593ba8d12bdd5d61cc933d1 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 19 Jul 2019 19:42:37 +0000 >Subject: [PATCH] Bug 16219: (follow-up) Nicer message if params missing and > note that they are not combined >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > misc/cronjobs/runreport.pl | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > >diff --git a/misc/cronjobs/runreport.pl b/misc/cronjobs/runreport.pl >index 869ede8168..89ef2154c1 100755 >--- a/misc/cronjobs/runreport.pl >+++ b/misc/cronjobs/runreport.pl >@@ -67,7 +67,7 @@ runreport.pl [ -h | -m ] [ -v ] reportID [ reportID ... ] > --to=s e-mail address to send report to > --from=s e-mail address to send report from > --subject=s subject for the e-mail >- --params=s parameters for the report >+ --param=s parameters for the report > --store-results store the result of the report > --csv-header add column names as first line of csv output > >@@ -123,9 +123,11 @@ E-mail address to send report from. Defaults to KohaAdminEmailAddress. > > Subject for the e-mail message. Defaults to "Koha Saved Report" > >-=item B<--params> >+=item B<--param> > >-Repeatable, should provide one param per param requested for the report >+Repeatable, should provide one param per param requested for the report. >+Report params are not combined as on the staff side, so you may need to repeat >+params. > > =item B<--store-results> > >@@ -263,7 +265,8 @@ foreach my $report_id (@ARGV) { > } > > # convert SQL parameters to placeholders >- $sql =~ s/(<<.*?>>)/\?/g; >+ my $params_needed = ( $sql =~ s/(<<.*?>>)/\?/g ); >+ die("You supplied ". scalar @params . " parameter(s) and $params_needed are required by the report") if scalar @params != $params_needed; > > my ($sth) = execute_query( $sql, undef, undef, \@params, $report_id ); > my $count = scalar($sth->rows); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16219
:
78434
|
90363
|
91668
|
92113
| 92114 |
92115