https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43744 --- Comment #1 from Olivia Reynolds <olivia.reynolds@openfifth.co.uk> --- Created attachment 207393 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207393&action=edit Bug 43744: Make the invoking report accessible in templates This patch adds support for fetching from the reports table to GetPreparedLetter, and uses this new functionality to make the relevant report available to the template as the "report" variable. Test plan: 1. Under Tools > Notices and Slips, create a notice in the Reports module. Choose a code and a name, and use "[% report.report_name %]" as the print *and* email body. 2. Under Reports, create a new report from SQL with a name and the following query: SELECT 1 AS borrowernumber, 'to@example.com' AS email; 4. Run this report with the template created earlier, and verify there is no output. 5. From the base of Koha, run the following command, replacing CODE with the notice code created earlier, and the ID with the report ID created earlier: misc/cronjobs/patron_emailer.pl -module report -from from@example.com -notice CODE -report ID 6. Verify that the email is generated successfully, and that there is no output from the template. 7. Apply patch. 8. Repeat steps 4-6, and verify both instances of template output now display the name of the report you're using to run it. Sponsored-by: Open Fifth -- You are receiving this mail because: You are watching all bug changes.