Commit 3a84d0a8 authored by metzlerd's avatar metzlerd
Browse files

Fixed the way contexts are passed from FrxReportContext

parent 0c1ca370
......@@ -25,6 +25,7 @@ class FrxReport {
public $html;
public $skin;
private $ids;
private $data_passed = FALSE;
public $teng;
public $parms;
public $missing_parms = FALSE;
......@@ -38,6 +39,7 @@ class FrxReport {
$this->parameters = array();
$this->options = array();
$this->parms = $data;
if ($data) $this->data_passed = TRUE;
$this->teng = new FrxSyntaxEngine(FRX_TOKEN_EXP, '{}', $this);
if ($xhtml) {
$dom = $this->dom = new DOMDocument('1.0', 'UTF-8');
......@@ -303,8 +305,8 @@ class FrxReport {
*/
public function render($format, $render_form=TRUE) {
if (!$format) $format = 'web';
// Only push the parameter context
if (!Frx::Data()->contextExists('parm')) Frx::Data()->push($this->parms, 'parm');
// Only push the parameter conte
Frx::Data()->push($this->parms, 'parm');
$this->format = $format;
$dom = $this->dom;
......
......@@ -322,6 +322,7 @@ function forena_query_preview($form, &$form_state) {
if ($fields) $fields = array_combine($fields, $fields);
$form_state['storage']['fields'] = $fields;
if ($fields) {
$report = $t->asXML();
$rpt = new FrxReport($report, $data);
$preview = $rpt->render('web', FALSE);
......
......@@ -97,7 +97,6 @@ class FrxPDO extends FrxDataSource {
$row_node->addChild($key, htmlspecialchars($value));
}
}
}
if ($this->debug) {
......
......@@ -9,7 +9,8 @@ class FrxReportContext {
// Get report based on current context and embed it.
public function getValue($key, $context) {
$output = forena_report($key, NULL, FALSE);
$context = Frx::Data()->currentContext();
$output = forena_report($key, $context, FALSE);
return $output;
}
......
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