From b9aff20f225dcb82dc0d34804d40221b42479648 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 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." --- .../mysql/atomicupdate/bug_28263_fix_auto_renewal_message.perl | 10 ++++++++++ installer/data/mysql/updatedatabase.pl | 6 +++--- 2 files changed, 13 insertions(+), 3 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..1cd00f8d60 --- /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'; + }); + + NewVersion( $DBversion, 28263, "Update AUTO_RENEWAL too_many message"); +} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 8c66f4f2f6..ba69184397 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -14441,7 +14441,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' %] @@ -22097,7 +22097,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{ @@ -23687,7 +23687,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.11.0