From 49df1cc10f45c1e7d9b15808a302df2a67dbb876 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 26 Jul 2016 15:00:58 +0000 Subject: [PATCH] Bug 16942 [QA Followup] - Add unit test Signed-off-by: Katrin Fischer Signed-off-by: Jesse Maseto Signed-off-by: Kyle M Hall --- C4/Reserves.pm | 2 +- t/db_dependent/Letters/TemplateToolkit.t | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index afdcb48c77..c9e270c8cf 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -2026,7 +2026,7 @@ sub _koha_notify_reserve { 'biblio' => $biblionumber, 'biblioitems' => $biblionumber, 'reserves' => $reserve, - 'items', $reserve->{'itemnumber'}, + 'items' => $reserve->{'itemnumber'}, }, substitute => { today => output_pref( { dt => dt_from_string, dateonly => 1 } ) }, ); diff --git a/t/db_dependent/Letters/TemplateToolkit.t b/t/db_dependent/Letters/TemplateToolkit.t index c4ecc5f7d1..4169556729 100644 --- a/t/db_dependent/Letters/TemplateToolkit.t +++ b/t/db_dependent/Letters/TemplateToolkit.t @@ -18,7 +18,7 @@ # along with Koha; if not, see . use Modern::Perl; -use Test::More tests => 13; +use Test::More tests => 14; use MARC::Record; @@ -188,6 +188,23 @@ $prepared_letter = GetPreparedLetter( ); is( $prepared_letter->{content}, $hold->id(), 'Hold object used correctly' ); +# Bug 16942 +$prepared_letter = GetPreparedLetter( + ( + module => 'test', + letter_code => 'TEST_HOLD', + tables => { + 'branches' => $library, + 'borrowers' => $patron, + 'biblio' => $biblio->id, + 'biblioitems' => $biblioitem->id, + 'reserves' => $hold->unblessed, + 'items' => $hold->itemnumber, + } + ) +); +is( $prepared_letter->{content}, $hold->id(), 'Hold object used correctly' ); + $sth->execute( "TEST_SERIAL", "[% serial.id %]" ); $prepared_letter = GetPreparedLetter( ( -- 2.39.5