Unverified Commit 680b0d40 authored by IKEDA Soji's avatar IKEDA Soji Committed by GitHub
Browse files

Merge pull request #954 from ikedas/issue-953 by ikedas

"false" values in XML file prevent list creation (#953)
parents ebe78372 60005144
......@@ -168,7 +168,7 @@ sub _getChildren {
if ($type == 1) {
# ELEMENT_NODE
my $values = _getChildren($child);
return undef unless $values;
return undef unless defined $values;
if ($child->getAttribute('multiple')) {
push @{$multiple_nodes->{$childName}}, $values;
......
......@@ -59,6 +59,16 @@ is_deeply(
is(Sympa::Config_XML->new(IO::Scalar->new(\(shift @in)))->as_hashref, undef);
is(Sympa::Config_XML->new(IO::Scalar->new(\(shift @in)))->as_hashref, undef);
# GH#953: "false" values in XML file prevent list creation
if (isnt(
my $h =
Sympa::Config_XML->new(IO::Scalar->new(\(shift @in)))->as_hashref,
undef
)
) {
is($h->{filtre}, '0');
}
done_testing();
__END__
......@@ -126,3 +136,21 @@ __END__
</owner>
</list>
<?xml version="1.0" encoding="UTF-8"?>
<list>
<listname>liste.org1.test</listname>
<subject>Liste test</subject>
<custom_subject>TEST</custom_subject>
<topics>communication</topics>
<reply_mail>noreply@domaine.fr</reply_mail>
<status>open</status>
<source>mysql</source>
<send>diffuseur</send>
<filtre>0</filtre>
<owner multiple="1">
<email>listmaster@domaine.fr</email>
<gecos>listmaster</gecos>
<reception>mail</reception>
</owner>
</list>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment