From 238578dc46496d296625c22f502d6d605cb96893 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? Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Fridolin Somers (cherry picked from commit 0f1f307ff84558ae9305140472d7ba5174975741) Signed-off-by: Andrew Fuerste-Henry --- 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 0000000000..b41fec92d7 --- /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 f105fb5df5..25deb84e5e 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -1476,6 +1476,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.39.5