From 3a722d814705f33acf87a653b1f9d2421af96832 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 29 Apr 2021 14:36:03 +0000 Subject: [PATCH] Bug 28263: Fix too_many auto renewal message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit To test: 1. Make an item eligible for auto_renewal. 2. Set circ rule so only 1 auto_renewal is allowd. 3. Run auto_renew once, get a successful message. 4. Run it again and get the too_many error "You have reached the maximum number of checkouts possible." 5. This has nothing to do with the number of checkouts 6. Apply patch and updatedatabase. 7. Do 1-4 again. 8. Message is now "You have reached the maximum number of renewals possible." Signed-off-by: David Nind Signed-off-by: Joonas Kylmälä Signed-off-by: Jonathan Druart --- .../bug_28263_fix_auto_renewal_message.perl | 10 ++++++++++ installer/data/mysql/en/mandatory/sample_notices.yml | 4 ++-- installer/data/mysql/updatedatabase.pl | 6 +++--- 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_28263_fix_auto_renewal_message.perl diff --git a/installer/data/mysql/atomicupdate/bug_28263_fix_auto_renewal_message.perl b/installer/data/mysql/atomicupdate/bug_28263_fix_auto_renewal_message.perl new file mode 100644 index 0000000000..cbfa8e846b --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_28263_fix_auto_renewal_message.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, "You have reached the maximum number of checkouts possible." , "You have reached the maximum number of renewals possible.") + WHERE ( code = 'AUTO_RENEWALS' OR code = 'AUTO_RENEWALS_DGST' ); + }); + + NewVersion( $DBversion, 28263, "Update AUTO_RENEWAL too_many message"); +} diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml index 517f380425..e95df89a87 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -1493,7 +1493,7 @@ tables: - "[% IF checkout.auto_renew_error %]" - "The following item, [% biblio.title %], has not been renewed because:" - "[% IF checkout.auto_renew_error == 'too_many' %]" - - "You have reached the maximum number of checkouts possible." + - "You have reached the maximum number of renewals possible." - "[% ELSIF checkout.auto_renew_error == 'on_reserve' %]" - "This item is on hold for another patron." - "[% ELSIF checkout.auto_renew_error == 'restriction' %]" @@ -1556,7 +1556,7 @@ tables: - "[% IF !checkout.auto_renew_error %]" - "was renewed until [% checkout.date_due | $KohaDates as_due_date => 1%]" - "[% ELSIF checkout.auto_renew_error == 'too_many' %]" - - "You have reached the maximum number of checkouts possible." + - "You have reached the maximum number of renewals possible." - "[% ELSIF checkout.auto_renew_error == 'on_reserve' %]" - "This item is on hold for another patron." - "[% ELSIF checkout.auto_renew_error == 'restriction' %]" diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 9cf2e81570..40cc2b2248 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -14440,7 +14440,7 @@ if( CheckVersion( $DBversion ) ) { [% IF checkout.auto_renew_error %] The following item, [% biblio.title %], has not been renewed because: [% IF checkout.auto_renew_error == 'too_many' %] -You have reached the maximum number of checkouts possible. +You have reached the maximum number of renewals possible. [% ELSIF checkout.auto_renew_error == 'on_reserve' %] This item is on hold for another patron. [% ELSIF checkout.auto_renew_error == 'restriction' %] @@ -22108,7 +22108,7 @@ if( CheckVersion( $DBversion ) ) { UPDATE letter SET name = REPLACE(name, "notification on auto renewing", "Notification of automatic renewal"), title = REPLACE(title, "Auto renewals", "Automatic renewal notice"), - content = REPLACE(content, "You have reach the maximum of checkouts possible.", "You have reached the maximum number of checkouts possible.") + content = REPLACE(content, "You have reach the maximum of checkouts possible.", "You have reached the maximum number of renewals possible.") WHERE code = 'AUTO_RENEWALS'; }); $dbh->do(q{ @@ -23698,7 +23698,7 @@ if( CheckVersion( $DBversion ) ) { [% IF !checkout.auto_renew_error %] was renewed until [% checkout.date_due | $KohaDates as_due_date => 1%] [% ELSIF checkout.auto_renew_error == 'too_many' %] - You have reached the maximum number of checkouts possible. + You have reached the maximum number of renewals possible. [% ELSIF checkout.auto_renew_error == 'on_reserve' %] This item is on hold for another patron. [% ELSIF checkout.auto_renew_error == 'restriction' %] -- 2.39.5