summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/export.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/php/include/export.inc.php')
-rw-r--r--frontends/php/include/export.inc.php31
1 files changed, 16 insertions, 15 deletions
diff --git a/frontends/php/include/export.inc.php b/frontends/php/include/export.inc.php
index a86f4a5b..84b0c52d 100644
--- a/frontends/php/include/export.inc.php
+++ b/frontends/php/include/export.inc.php
@@ -325,22 +325,23 @@
// based on mod by scricca
$data = DBfetch(DBselect('SELECT hp.* FROM hosts_profiles hp WHERE hp.hostid='.$hostid));
- if(!$data) return false;
-
- zbx_xmlwriter_start_element ($memory,XML_TAG_HOSTPROFILE);
-
- $map =& $ZBX_EXPORT_MAP[XML_TAG_HOSTPROFILE];
-
- foreach($map['attribures'] as $db_name => $xml_name){
- if(empty($xml_name)) $xml_name = $db_name;
- zbx_xmlwriter_write_attribute($memory, $xml_name, $data[$db_name]);
- }
- foreach($map['elements'] as $db_name => $xml_name){
- if(empty($data[$db_name])) continue;
- if(empty($xml_name)) $xml_name = $db_name;
- zbx_xmlwriter_write_element($memory, $xml_name, $data[$db_name]);
+// if(!$data) return false;
+ if($data){
+ zbx_xmlwriter_start_element ($memory,XML_TAG_HOSTPROFILE);
+
+ $map =& $ZBX_EXPORT_MAP[XML_TAG_HOSTPROFILE];
+
+ foreach($map['attribures'] as $db_name => $xml_name){
+ if(empty($xml_name)) $xml_name = $db_name;
+ zbx_xmlwriter_write_attribute($memory, $xml_name, $data[$db_name]);
+ }
+ foreach($map['elements'] as $db_name => $xml_name){
+ if(empty($data[$db_name])) continue;
+ if(empty($xml_name)) $xml_name = $db_name;
+ zbx_xmlwriter_write_element($memory, $xml_name, $data[$db_name]);
+ }
+ zbx_xmlwriter_end_element($memory); // XML_TAG_HOSTPROFILE
}
- zbx_xmlwriter_end_element($memory);
//--
if($db_groups = DBselect('select g.name from groups g, hosts_groups hg'.