Bug 25506: Fix for "Use of uninitialized value" in about.pl

Perl warning on the "About Koha" page:

Use of uninitialized value in string eq
at /home/vagrant/kohaclone/about.pl line 220.

Fixed by adding additional precheck for
C4::Context->config('zebra_auth_index_mode') being Perl's "true".

To test:
    1) Ensure you don't have "<zebra_auth_index_mode>...
       </zebra_auth_index_mode>" in your koha-conf.xml so you will have
       "C4::Context->config" returning "undef"
    2) Go to the "About Koha" page.
    3) Observe the warning in the log file.
    4) Apply patch.
    5) Repeat step 2.
    6) Check that previous warning was suppressed.

Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 67ff0f7285)
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>

(cherry picked from commit 95c56339b9)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
This commit is contained in:
Slava Shishkin 2020-05-14 17:53:47 +03:00 committed by Victor Grousset/tuxayo
parent fdc0cfa713
commit 11db96d435
1 changed files with 4 additions and 1 deletions

View File

@ -189,7 +189,10 @@ if ( C4::Context->config('zebra_auth_index_mode')
push @xml_config_warnings, { error => 'zebra_auth_index_mode_is_grs1' };
}
if ( (C4::Context->config('zebra_auth_index_mode') eq 'dom') && ($context->{'server'}->{'authorityserver'}->{'config'} !~ /zebra-authorities-dom.cfg/) ) {
if( ( C4::Context->config('zebra_auth_index_mode')
and C4::Context->config('zebra_auth_index_mode') eq 'dom' )
&& ( $context->{'server'}->{'authorityserver'}->{'config'} !~ /zebra-authorities-dom.cfg/ ) )
{
push @xml_config_warnings, {
error => 'zebra_auth_index_mode_mismatch_warn'
};