Bugzilla – Attachment 119682 Details for
Bug 28125
All OPAC holds blocked when OPACHiddenItems contains incorrect values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28125: Display a warning on the about page for OPACHiddenItems is needed
Bug-28125-Display-a-warning-on-the-about-page-for-.patch (text/plain), 7.46 KB, created by
Nick Clemens (kidclamp)
on 2021-04-15 19:19:48 UTC
(
hide
)
Description:
Bug 28125: Display a warning on the about page for OPACHiddenItems is needed
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-04-15 19:19:48 UTC
Size:
7.46 KB
patch
obsolete
>From e86afae9a5d15efec1a20be7e95e2cec0f5a2e7a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 13 Apr 2021 10:47:19 +0200 >Subject: [PATCH] Bug 28125: Display a warning on the about page for > OPACHiddenItems is needed > >If OPACHiddenItems is containing badly construct it will lead to >inconsistent behaviours. For instance the holds view will not display >any items, when the detail page will display all of them (because we are >not using the same code, we are in transition to merge it). > >This patch suggests to add a warning to the about page in case the query >generated by Koha::Items->filter_by_visible_in_opac produces a warning > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > about.pl | 5 +++++ > koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 7 +++++-- > t/db_dependent/Koha/Items.t | 8 +++++++- > 3 files changed, 17 insertions(+), 3 deletions(-) > >diff --git a/about.pl b/about.pl >index 376f77c6aa..90b434904c 100755 >--- a/about.pl >+++ b/about.pl >@@ -201,6 +201,10 @@ my $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist = ( not $anonymous_pat > > my $warnPrefKohaAdminEmailAddress = not Email::Valid->address(C4::Context->preference('KohaAdminEmailAddress')); > >+my $c = Koha::Items->filter_by_visible_in_opac->count; >+my @warnings = C4::Context->dbh->selectrow_array('SHOW WARNINGS'); >+my $warnPrefOpacHiddenItems = $warnings[2]; >+ > my $invalid_yesno = Koha::Config::SysPrefs->search( > { > type => 'YesNo', >@@ -601,6 +605,7 @@ $template->param( > warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist => $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist, > warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist => $warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist, > warnPrefKohaAdminEmailAddress => $warnPrefKohaAdminEmailAddress, >+ warnPrefOpacHiddenItems => $warnPrefOpacHiddenItems, > errZebraConnection => $errZebraConnection, > warnIsRootUser => $warnIsRootUser, > warnNoActiveCurrency => $warnNoActiveCurrency, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >index f589c65810..064584558c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >@@ -215,7 +215,7 @@ > </div> > > <div id="sysinfo"> >- [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || invalid_yesno.count || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || warnConnectBroker %] >+ [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnPrefOpacHiddenItems || invalid_yesno.count || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || warnConnectBroker %] > [% IF (warnIsRootUser) %] > <h2>Warning regarding current user</h2> > <p>You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account.</p> >@@ -299,7 +299,7 @@ > Contact your system administrator. > [% END %] > >- [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || invalid_yesno.count || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || paypal_enabled %] >+ [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnPrefOpacHiddenItems || invalid_yesno.count || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || paypal_enabled %] > <h2>Warnings regarding the system configuration</h2> > <table> > <caption>Preferences and parameters</caption> >@@ -324,6 +324,9 @@ > [% IF warnPrefKohaAdminEmailAddress %] > <tr><th scope="row"><strong>Warning</strong> </th><td>System preference 'KohaAdminEmailAddress' does not contain a valid email address. Emails will not be sent.</td></tr> > [% END %] >+ [% IF warnPrefOpacHiddenItems %] >+ <tr><th scope="row"><strong>Warning</strong> </th><td>System preference 'OpacHiddenItems' generates a warning and will produce unexpected behaviors: [% warnPrefOpacHiddenItems %]</th></tr> >+ [% END %] > [% IF invalid_yesno.count %] > [% FOR p IN invalid_yesno %] > <tr><th scope="row"><strong>Warning</strong> </th><td>System preference '[% p.variable | html %]' must be '0' or '1', but is [% IF p.value.defined %]'[% p.value | html%]'[% ELSE %]NULL[% END %].</td></tr> >diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t >index d1d910b020..73e1ab4a29 100755 >--- a/t/db_dependent/Koha/Items.t >+++ b/t/db_dependent/Koha/Items.t >@@ -1494,7 +1494,7 @@ $schema->storage->txn_rollback; > > subtest 'filter_by_visible_in_opac() tests' => sub { > >- plan tests => 11; >+ plan tests => 12; > > $schema->storage->txn_begin; > >@@ -1641,6 +1641,12 @@ subtest 'filter_by_visible_in_opac() tests' => sub { > 'The right item is returned' > ); > >+ # Make sure the warning on the about page will work >+ $rules = { itemlost => ['AB'] }; >+ my $c = Koha::Items->filter_by_visible_in_opac->count; >+ my @warnings = C4::Context->dbh->selectrow_array('SHOW WARNINGS'); >+ is( $warnings[2], q{Truncated incorrect DOUBLE value: 'AB'}); >+ > $schema->storage->txn_rollback; > }; > >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28125
:
119513
|
119534
|
119539
|
119540
| 119682 |
119683