From 489b08ab4c1da6933b6d23483aab75a6c2e923b5 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 6 Nov 2020 12:34:11 +0000 Subject: [PATCH] Bug 26950: Make Anonymous patron warnings 'errors' and refer to the system information tab on about.pl Currently checkins can fail for one of two known reasons: 1 - Duplicate issue ids 2 - Anonymous borrower configuration issues In the first case we refer to the 'data problems' or 'data corrupted' section of the about page. All errors are on the 'System information' tab and this is what we should mention In the second case we refer to the data problems section, but information is in another section on the tab. Additionally, during checkin we issue an 'Error' but on the about page we call it a 'Warning' we should upgrade to error and specify what is broken Additionally this patch fixes the warning that should display while issuing to a patron if anonymous is not set and patron has selected privacy To test: 1 - Enable system preference OPACPrivacy 2 - Set system preference AnonymousPatron to '0' 3 - Log in a a patron on OPAC and set your privacy to never 4 - Issue a book to that patron in the staff client 5 - Note there is no warning 6 - Return the book 7 - Note the circulation page displays an error and the checkin fails and refers to 'data problems' 8 - Apply patch 9 - Issue another book to patron 10 - Note warning on the circulation page 11 - Try to check in a book again 12 - Check the new message makes sense 13 - Click the link to 'about.pl' check that errors are displayed 14 - Check the logs 15 - Confirm updated error message makes sense Signed-off-by: Fridolin Somers Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- C4/Circulation.pm | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 4 ++-- koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index e2bdf79c21..50c436ecba 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2072,7 +2072,7 @@ sub AddReturn { _CalculateAndUpdateFine( { issue => $issue, item => $item->unblessed, borrower => $patron_unblessed, return_date => $return_date } ); } } else { - carp "The checkin for the following issue failed, Please go to the about page, section 'data corrupted' to know how to fix this problem ($@)" . Dumper( $issue->unblessed ); + carp "The checkin for the following issue failed, Please go to the about page and check all messages on the 'System information' to see if there are configuration / data issues ($@)" . Dumper( $issue->unblessed ); my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); $indexer->index_records( $item->biblionumber, "specialUpdate", "biblioserver" ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 88d2df0b89..32a16a11f9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -293,13 +293,13 @@ Warning System preference 'EasyAnalyticalRecords' set, but UseControlNumber preference is set to 'Use'. Set it to 'Don't use' or else the 'Show analytics' links in the staff interface and the OPAC will be broken. [% END %] [% IF warnPrefAnonymousPatronOPACPrivacy %] - Warning System preference 'OPACPrivacy' set, but AnonymousPatron preference is set to '0'. Set it to a valid borrower number if you want that this feature works correctly. + Error System preference 'OPACPrivacy' set, but AnonymousPatron preference is set to '0'. Set it to a valid borrower number or checkins for these patrons will fail. [% END %] [% IF warnPrefAnonymousPatronAnonSuggestions %] Warning System preference 'AnonSuggestions' set, but AnonymousPatron preference is set to '0'. Set it to a valid borrower number if you want that this feature works correctly. [% END %] [% IF warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist %] - Warning Some patrons have requested a privacy on returning item but the AnonymousPatron pref is not set correctly. Set it to a valid borrower number if you want that this feature works correctly. + Error Some patrons have requested a privacy on returning item but the AnonymousPatron pref is not set correctly. Set it to a valid borrower number or checkins for these patrons will fail. [% END %] [% IF warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist %] Warning System preference 'AnonSuggestions' set, but AnonymousPatron preference is not set correctly. Set it to a valid borrower number if you want that this feature works correctly. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 0a7d40c8a8..a4f7369bb2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -512,7 +512,7 @@ [% IF patron %] - [% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %] + [% IF patron.privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
Error: This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 4ebc4cd40f..c2bdd03bb9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -294,7 +294,7 @@

Reminder: Patron has an indefinite restriction.

[% END %] [% IF errmsgloo.data_corrupted %] -

The item has not been checked in due to a configuration issue in your system. You must ask an administrator to take a look at the about page and search for the "data problems" section

+

The item has not been checked in due to a configuration issue in your system. You must ask an administrator to take a look at the about page and correct all errors shown on the "System information" tab

[% END %] [% END # /FOREACH errmsgloo %] -- 2.39.5