From 67a2d18fbcb338ca4fffb5150a567ebbc5e1ab01 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 22 Oct 2014 15:56:29 -0300 Subject: [PATCH] Bug 13087: Add a notice for use_zebra_facets problems in about page This patch adds two checks to about.pl: - use_zebra_facets entry presence in koha-conf.xml - use_zebra_facets==1 and zebra_bib_index_mode==dom The idea is to alert the user if it has conflicting or wrong settings. Even if there's a fallback to a working configuration. To test: - On clean master install, go to the about page => SUCCESS: No warnings regarding use_zebra_facets - Comment out the use_zebra_facets entry, reload => SUCCESS: The about page mentions the use_zebra_facets entry is missing - Uncomment the use_zebra_facets entry, make sure it is set to 1 - Change zebra_bib_index_mode to 'grs1', reload => SUCCESS: The about page says zebra_bib_index_mode is not set to DOM even though you have use_zebra_facets set. - Sign off :-D Regards To+ Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Owen Leonard Followed test plan with success Signed-off-by: Katrin Fischer Works as described, tested by changing the koha-conf.xml file. Note: There is no warning if use_zebra_facets is 0. Signed-off-by: Tomas Cohen Arazi --- about.pl | 13 +++++++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/about.pl b/about.pl index d144e371bb..339f4e2820 100755 --- a/about.pl +++ b/about.pl @@ -121,6 +121,19 @@ if ( C4::Context->preference( 'UseQueryParser' ) ) { } } +# Test Zebra facets configuration +if ( !defined C4::Context->config('use_zebra_facets') ) { + push @xml_config_warnings, { error => 'use_zebra_facets_entry_missing' }; +} else { + if ( C4::Context->config('use_zebra_facets') && + C4::Context->config('zebra_bib_index_mode') ) { + # use_zebra_facets works with DOM + push @xml_config_warnings, { + error => 'use_zebra_facets_needs_dom' + } if C4::Context->config('zebra_bib_index_mode') ne 'dom' ; + } +} + $template->param( kohaVersion => $kohaVersion, osVersion => $osVersion, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index a5ce2f8127..75a367db37 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -155,6 +155,20 @@ file. [% config_entry.file %] is used as a fallback. + [% ELSIF config_entry.error == 'use_zebra_facets_entry_missing' %] + + Warning + The <use_zebra_facets> entry is missing in your configuration file. Falling back + to legacy facet calculation. + + + [% ELSIF config_entry.error == 'use_zebra_facets_needs_dom' %] + + Warning + You have set <use_zebra_facets> but the <zebra_bib_index_mode> is not set to dom. Falling back + to legacy facet calculation. + + [% END %] [% END %] -- 2.39.5