Permalink
Browse files

[#19664789] Print Hold notice generated even if msg pref off

If a patron record had no email address, and the messaging
preference for Hold Filled was not checked, a print hold notice
was being generated anyway.  This commit adds a check for the
messaging preference before generating a print hold notice.
  • Loading branch information...
1 parent f269481 commit c692ead7f0346fb5bc437ae1237cce685fb0f6c1 Jane Wagner committed with ctfliblime Jan 20, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/C4/Reserves.pm
View
@@ -2378,11 +2378,9 @@ sub _koha_notify_reserve {
my $borrower = C4::Members::GetMember( $borrowernumber );
my $letter_code;
my $print_mode = 0;
- my $messagingprefs;
+ my $messagingprefs = C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $borrowernumber, message_name => 'Hold Filled' } );
+ return if ( !defined( $messagingprefs->{'letter_code'} ) );
if ( $borrower->{'email'} || $borrower->{'smsalertnumber'} ) {
- $messagingprefs = C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $borrowernumber, message_name => 'Hold Filled' } );
-
- return if ( !defined( $messagingprefs->{'letter_code'} ) );
$letter_code = $messagingprefs->{'letter_code'};
} else {
$letter_code = 'HOLD_PRINT';

0 comments on commit c692ead

Please sign in to comment.