From 847b6bd5419327eb2cc8a4a0c7d1b79956f57a85 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 28 Apr 2021 20:48:37 +0000 Subject: [PATCH] Bug 28258: Update bad formatting in AUTO_RENEWALS notice To test: -Look at the AUTO_RENEWALS notice and see the syntax [% checkout.date_due as_due_date => 1 %] -Apply patch, updatedatabase -Look at the AUTO_RENEWALS notice and see the syntax [% checkout.date_due | $KohaDates as_due_date => 1%] Additional test: 1 - Checkout an item to a patron 2 - Find their borrowernumber, the itemnumber, and the biblionumber 3 - Use the get_prepared_letter script to test the letter content perl misc/devel/get_prepared_letter.pl --module circulation --letter-code AUTO_RENEWALS --tables="{\"borrowers\": 5,\"issues\": 1040,\"items\": 1040,\"biblio\": 2 }" Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart (cherry picked from commit d8491c6eb294a3cfb77665daa444682e7bee8dd5) Signed-off-by: Fridolin Somers (cherry picked from commit 2412990733dda49253715facd470d6d8ec5c170f) Signed-off-by: Andrew Fuerste-Henry --- .../bug_28258_update_auto_renewals_template.perl | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_28258_update_auto_renewals_template.perl diff --git a/installer/data/mysql/atomicupdate/bug_28258_update_auto_renewals_template.perl b/installer/data/mysql/atomicupdate/bug_28258_update_auto_renewals_template.perl new file mode 100644 index 0000000000..612c20cac5 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_28258_update_auto_renewals_template.perl @@ -0,0 +1,10 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{ + UPDATE letter SET + content = REPLACE(content, "The following item, [% biblio.title %], has correctly been renewed and is now due on [% checkout.date_due as_due_date => 1 %]" , "The following item, [% biblio.title %], has correctly been renewed and is now due on [% checkout.date_due | $KohaDates as_due_date => 1 %]") + WHERE code = 'AUTO_RENEWALS'; + }); + + NewVersion( $DBversion, 28258, "Update AUTO_RENEWAL content"); +} -- 2.39.5