If you have a SQL report with runtime parameters, and you click "Run with template", it'll prompt for runtime parameter inputs, but then it will render a normal SQL output and not the template output. If you do the same thing again, it will work the second time, because the param_name and sql_params URL parameters are now added to the link.
Created attachment 179136 [details] [review] Bug 39298: Add runtime parameter support to report templates This change makes it so that you can provide runtime parameters and use "Run with template". Test plan: 0. Apply the patch and koha-plack --restart kohadev 1. Create a report template. For example: <table> <tr><th>Transformed Biblionumber</th></tr> [% FOREACH row IN data %] <tr><td>Biblionumber [% row.biblionumber %]</td></tr> [% END %] </table> 2. Create a SQL report with a runtime parameter. For example: SELECT biblionumber FROM biblio WHERE biblionumber > <<biblionumber>> 3. Run the report using "Run with template" 4. Specify a biblionumber of 1 5. Click "Run the report" 6. Note that the output is the template output and not regular SQL output
Created attachment 179145 [details] [review] Bug 39298: Add runtime parameter support to report templates This change makes it so that you can provide runtime parameters and use "Run with template". Test plan: 0. Apply the patch and koha-plack --restart kohadev 1. Create a report template. For example: <table> <tr><th>Transformed Biblionumber</th></tr> [% FOREACH row IN data %] <tr><td>Biblionumber [% row.biblionumber %]</td></tr> [% END %] </table> 2. Create a SQL report with a runtime parameter. For example: SELECT biblionumber FROM biblio WHERE biblionumber > <<biblionumber>> 3. Run the report using "Run with template" 4. Specify a biblionumber of 1 5. Click "Run the report" 6. Note that the output is the template output and not regular SQL output Signed-off-by: David Nind <david@davidnind.com>
Testing notes (using KTD) - replicating the issue before applying the patch: 1. The first time you run the report using the report template option, it will look like a normal report result - with standard pagination and a column with just the biblionumber. 2. If you then go "Run with template" again, you will then get your customised output, in this case a table with all the results formatted using the template: a table heading called "Transformed Biblionumber" and then rows with "Biblionumber X" (where X = a number).