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

--- Comment #50 from Jan Kissig <[email protected]> ---
Hey Emily, thanks for the patches! I finally found some time to QA here, so
sorry for the delay.

1. I still have small remarks concerning the tests in
t/db_dependent/Koha/Patrons.t:

in earlier commits (f.e. comment #33) you were checking for existing phone and
sms templates like

my $expiry_phone =
   Koha::Notice::Templates->search( { code => 'MEMBERSHIP_RENEWED',
message_transport_type => 'phone' } );
my $expiry_sms =
   Koha::Notice::Templates->search( { code => 'MEMBERSHIP_RENEWED',
message_transport_type => 'sms' } );

if ( !$expiry_phone ) { 
  # add template
}

if ( !$expiry_sms ) { 
  # add template
}


In the latest patch that checks for existing templates are gone, but the number
of rows for these templates are saved in $expiry_phone (or $expiry_sms) instead
(but not used).
Then the templates for phone and sms are stored anyway:

my $expiry_phone =
     Koha::Notice::Templates->search( { code => 'MEMBERSHIP_RENEWED',
message_transport_type => 'phone' } )->count;
my $expiry_sms =
     Koha::Notice::Templates->search( { code => 'MEMBERSHIP_RENEWED',
message_transport_type => 'sms' } )->count;

This could lead to a violation of unique constraints when the templates with
that transport and code are already existing.
Also the templates were created using code=MEMBERSHIP_RENEWED instead of
MEMBERSHIP_EXPIRY (negligible issue here as the fallback
mail->phone->sms->print is managed via the is_notice_mandatory flag)

2. In "Bug 40294: Show transport preference for mandatory expiry notice" you
mentioned a follow-up for validating if at least one transport is selected if
the notice is mandatory. Do you want to include the validation in this patch or
should that moved to another bug?

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to