Bug 28263: Fix too_many auto renewal message
authorLucas Gass <lucas@bywatersolutions.com>
Thu, 29 Apr 2021 14:36:03 +0000 (14:36 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 2 Nov 2021 15:50:01 +0000 (16:50 +0100)
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 <david@davidnind.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
installer/data/mysql/atomicupdate/bug_28263_fix_auto_renewal_message.perl [new file with mode: 0644]
installer/data/mysql/en/mandatory/sample_notices.yml
installer/data/mysql/updatedatabase.pl

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 (file)
index 0000000..cbfa8e8
--- /dev/null
@@ -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");
+}
index 517f380..e95df89 100644 (file)
@@ -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' %]"
index 9cf2e81..40cc2b2 100755 (executable)
@@ -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' %]