Browse Source

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 <oleonard@myacpl.org>
Followed test plan with success

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
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 <tomascohen@gmail.com>
MM-OPAC/theme_dep
Tomás Cohen Arazi 10 years ago
parent
commit
67a2d18fbc
  1. 13
      about.pl
  2. 14
      koha-tmpl/intranet-tmpl/prog/en/modules/about.tt

13
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,

14
koha-tmpl/intranet-tmpl/prog/en/modules/about.tt

@ -155,6 +155,20 @@
file. <strong>[% config_entry.file %]</strong> is used as a fallback.
</td>
</tr>
[% ELSIF config_entry.error == 'use_zebra_facets_entry_missing' %]
<tr>
<th scope="row"><b>Warning</b></th>
<td>The &lt;use_zebra_facets&gt; entry is missing in your configuration file. Falling back
to legacy facet calculation.
</td>
</tr>
[% ELSIF config_entry.error == 'use_zebra_facets_needs_dom' %]
<tr>
<th scope="row"><b>Warning</b></th>
<td>You have set &lt;use_zebra_facets&gt; but the &lt;zebra_bib_index_mode&gt; is not set to <strong>dom</strong>. Falling back
to legacy facet calculation.
</td>
</tr>
[% END %]
[% END %]
</table>

Loading…
Cancel
Save