[Koha-bugs] [Bug 16219] Runreport.pl should allow SQL parameters to be passed on the command line

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sun Jun 9 22:54:10 CEST 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16219

Katrin Fischer <katrin.fischer at bsz-bw.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Signed Off                  |Failed QA

--- Comment #3 from Katrin Fischer <katrin.fischer at bsz-bw.de> ---
This works, but feels a little hacky:
- When the report expects params, the SQL message is output. We could possibly
print a nicer error message instead with the number of params to expected.
- When the report is built with reusable variables, you need to enter each of
those on command line. If not easy to fix, hinting at it in the help might be
good.

My example query was:
select * from items where holdingbranch = <<b|branches>> and homebranch =
<<b|branches>> and itype= <<i>>

So b will be shown as 1 input field, but will be required twice in the command:

./misc/cronjobs/runreport.pl 1 --param=CPL --param=BK
DBD::mysql::st execute failed: called with 4 bind variables when 5 are needed
[for Statement "select * from items where holdingbranch = ? and homebranch = ?
and itype= ? LIMIT ?, ?" with ParamValues: 0=Null!, 1=Null!, 2=Null!, 3=Null!,
4=Null!] at /home/vagrant/kohaclone/C4/Reports/Guided.pm line 544.
NO OUTPUT: 0 results from execute_query

./misc/cronjobs/runreport.pl 1 --param=CPL --param=CPL --param=BK
Works.

Pushing back to Nick for comment.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list