Fix PluginTools datalist modules

This commit is contained in:
fbsanchez 2018-02-01 13:59:22 +01:00
parent 0d944f0322
commit c02237a27f
1 changed files with 8 additions and 1 deletions

View File

@ -427,7 +427,14 @@ sub print_module {
if (ref ($data->{value}) eq "ARRAY") {
$xml_module .= "\t<datalist>\n";
foreach (@{$data->{value}}) {
$xml_module .= "\t<data><![CDATA[" . $data->{value} . "]]></data>\n";
if ((ref($_) eq "HASH") && defined($_->{value})) {
$xml_module .= "\t<data>\n";
$xml_module .= "\t\t<value><![CDATA[" . $_->{value} . "]]></value>\n";
if (defined($_->{timestamp})) {
$xml_module .= "\t\t<timestamp><![CDATA[" . $_->{timestamp} . "]]></timestamp>\n";
}
$xml_module .= "\t</data>\n";
}
}
$xml_module .= "\t</datalist>\n";
}