};
}
+# Test QueryParser configuration sanity
+if ( C4::Context->preference( 'UseQueryParser' ) ) {
+ # Get the QueryParser configuration file name
+ my $queryparser_file = C4::Context->config( 'queryparser_config' );
+ my $queryparser_fallback_file = '/etc/koha/searchengine/queryparser.yaml';
+ # Check QueryParser is functional
+ my $QParser = C4::Context->queryparser();
+ my $queryparser_error = {};
+ if ( ! defined $QParser || ref($QParser) ne 'Koha::QueryParser::Driver::PQF' ) {
+ # Error initializing the QueryParser object
+ # Get the used queryparser.yaml file path to report the user
+ $queryparser_error->{ fallback } = ( defined $queryparser_file ) ? 0 : 1;
+ $queryparser_error->{ file } = ( defined $queryparser_file )
+ ? $queryparser_file
+ : $queryparser_fallback_file;
+ # Report error data to the template
+ $template->param( QueryParserError => $queryparser_error );
+ } else {
+ # Check for an absent queryparser_config entry in koha-conf.xml
+ if ( ! defined $queryparser_file ) {
+ # Not an error but a warning for the missing entry in koha-conf-xml
+ push @xml_config_warnings, {
+ error => 'queryparser_entry_missing',
+ file => $queryparser_fallback_file
+ };
+ }
+ }
+}
+
$template->param(
kohaVersion => $kohaVersion,
osVersion => $osVersion,
<p>Please log in instead with a regular staff account. To create a staff account, create a library, a patron category 'Staff' and add a new patron. Then give this patron permissions from 'More' in the toolbar.</p>
[% END %]
<h2>Warnings regarding the system configuration</h2>
- [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnNoActiveCurrency %]
+ [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron ||
+ warnNoActiveCurrency || QueryParserError %]
<table>
<caption>Preferences and parameters</caption>
[% IF (warnPrefBiblioAddsAuthorities) %]
[% IF warnNoActiveCurrency %]
<tr><th scope="row"><b>Warning</b> </th><td>No active currency is defined. Please go to <a href="/cgi-bin/koha/admin/currency.pl">Administration > Currencies and exchange rates</a> and mark one currency as active.</td></tr>
[% END %]
+ [% IF QueryParserError %]
+ <tr><th scope="row"><b>Warning</b> </th><td>
+ You have set UseQueryParser but there was a problem inititializing QueryParser.
+ [% IF QueryParserError.fallback %]
+ The 'queryparser_config' entry is missing in your configuration file.
+ <strong>[% QueryParserError.file %]</strong> was used instead without success.
+ [% ELSE %]
+ The following configuration file was used without success: <strong>[% QueryParserError.file %]</strong>.
+ [% END %]
+ </td>
+ </tr>
+ [% END %]
+
</table>
[% END %]
[% IF xml_config_warnings.size %]
<tr><th scope="row"><b>Warning</b> </th><td>The <zebra_bib_index_mode> entry is missing in your configuration file. It should be set to <strong>dom</strong> or <strong>grs1</strong>. It will default to <strong>grs1</strong> but this could change in the future.</td></tr>
[% ELSIF config_entry.error == 'zebra_auth_index_mode_warn' %]
<tr><th scope="row"><b>Warning</b> </th><td>The <zebra_auth_index_mode> entry is missing in your configuration file. It should be set to <strong>dom</strong> or <strong>grs1</strong>. It will default to <strong>dom</strong> but this could change in the future.</td></tr>
+ [% ELSIF config_entry.error == 'queryparser_entry_missing' %]
+ <tr>
+ <th scope="row"><b>Warning</b></th>
+ <td>You have set UseQueryParser but the 'queryparser_config' entry is missing in your configuration
+ file. <strong>[% config_entry.file %]</strong> is used as a fallback.
+ </td>
+ </tr>
[% END %]
[% END %]
</table>