From 4061165d425adf8e99626c63cfe1e254e3914226 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 23 Nov 2021 14:48:22 +0100 Subject: [PATCH] Bug 29557: Add auto_account_expired to AUTO_RENEWALS It was missing and the notice sent was not providing the reason of the failure. Test plan: Check an item out with a date in the past, mark it as auto renew Modify the expired date of the patron and set it in the past Run the automatic_renewals.pl cronjob script, confirm that the notice now contains the reason of the failure. QA note: The template will be updated only for English installations. Should we add an alert for others? --- installer/data/mysql/atomicupdate/bug_29557.pl | 15 +++++++++++++++ .../data/mysql/en/mandatory/sample_notices.yml | 2 ++ 2 files changed, 17 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_29557.pl diff --git a/installer/data/mysql/atomicupdate/bug_29557.pl b/installer/data/mysql/atomicupdate/bug_29557.pl new file mode 100755 index 00000000000..b41fec92d7c --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_29557.pl @@ -0,0 +1,15 @@ +use Modern::Perl; + +return { + bug_number => "29557", + description => "Add auto_account_expired to AUTO_RENEWALS", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + my @c = $dbh->do(q{ + UPDATE letter + SET content=REPLACE(content, "[% ELSIF checkout.auto_renew_error == 'too_unseen' %]\r\nThis item must be renewed at the library.\r\n[% END %]", "[% ELSIF checkout.auto_renew_error == 'too_unseen' %]\r\nThis item must be renewed at the library.\r\n[% ELSIF checkout.auto_renew_error == 'auto_account_expired' %]\r\nYour account has expired.\r\n[% END %]") + WHERE code="AUTO_RENEWALS" + }); + }, +} diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml index 48e1f030bf1..52d0dbd4cec 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -1509,6 +1509,8 @@ tables: - "Your total unpaid fines are too high." - "[% ELSIF checkout.auto_renew_error == 'too_unseen' %]" - "This item must be renewed at the library." + - "[% ELSIF checkout.auto_renew_error == 'auto_account_expired' %]" + - "Your account has expired." - "[% END %]" - "[% ELSE %]" - "The following item, [% biblio.title %], has correctly been renewed and is now due on [% checkout.date_due | $KohaDates as_due_date => 1 %]" -- 2.25.1