Warning when changing the configuration
Concerned version
Version: 2.0.11
Platform: Apache 2.4 / perl 5.16.3
Summary
When I change the configuration using the CLI, the command ends successfully but reports a warning:
Warnings: [
'Test AuthChoiceParams failed: Can\'t use an undefined value
as a HASH reference at
/usr/share/perl5/vendor_perl/Lemonldap/NG/Manager/Conf/Tests.pm line
972, <FILE> line 1.
'
];
Details
It seems there is a perl issue in a test:
# AuthChoice parameters must exist
AuthChoiceParams => sub {
here -> return 1 unless %{ $conf->{authChoiceModules} };
foreach (qw(AuthBasic FindUser)) {
if ( $conf->{"authChoice$_"} ) {
my $test = $conf->{"authChoice$_"};
my $param = grep /^$test$/,
keys %{ $conf->{authChoiceModules} };
return ( -1, "Choice $_ parameter does not exist" )
unless $param;
}
}
return 1;
},
In my configuration file, I can find:
"authChoiceParam" : "lmAuth",
but no authChoiceModules
.
Backends used
The configuration backend is File
.
Possible fixes
Changing the line
return 1 unless %{ $conf->{authChoiceModules} };
by
return 1 unless $conf->{authChoiceModules};
avoid the warning.