Commit eb22be3d authored by David Metzler's avatar David Metzler
Browse files

Improved error messages.

parent a402a1f8
......@@ -51,7 +51,14 @@ class FrxReport {
if (is_object($xhtml)) $xhtml = $xhtml->asXML();
// Load document and simplexml representation
$dom->loadXML($xhtml);
try {
$success = $dom->loadXML($xhtml);
}
catch(Exception $e) {
return;
}
if (!$success) return;
$dom->formatOutput = TRUE;
$rpt_xml = $this->rpt_xml = simplexml_import_dom($dom);
......
......@@ -169,21 +169,25 @@ class FrxReportFile extends FrxFile {
try {
$r_xml =file_get_contents($object->file);
// Load the report
$r = new FrxReport($r_xml);
$r = @new FrxReport($r_xml);
} catch (Exception $e) {
}
if (!$r->rpt_xml) {
$s = t('Unable to load Report %s', array('%s' => $object->file));
if (user_access('design any report')) {
drupal_set_message($s, 'error');
drupal_set_message($s, 'error', FALSE);
}
}
}
// Get the security caches from the reports
$cache = isset($r->rpt_xml) ? forena_load_cache($r->rpt_xml) : 'report load error';
$cache['title'] = $r->title;
$cache['language'] = $lang;
$cache['category'] = $r->category;
$cache['hidden'] = @$r->options['hidden'];
//$cache['hidden'] = $r->options['hidden'];
$cache = isset($r->rpt_xml) ? forena_load_cache($r->rpt_xml) : NULL;
if ($r->rpt_xml) {
$cache['title'] = $r->title;
$cache['language'] = $lang;
$cache['category'] = $r->category;
$cache['hidden'] = @$r->options['hidden'];
//$cache['hidden'] = $r->options['hidden'];
}
$object->cache = $cache;
if ($r) $r->__destruct();
unset($r);
......
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