Commit f74b229a authored by metzlerd's avatar metzlerd
Browse files

#2504969 Fixed block data preview redirecting to home page.

parent c254cc6c
...@@ -914,7 +914,8 @@ class FrxEditor { ...@@ -914,7 +914,8 @@ class FrxEditor {
public function preview($parms = array()) { public function preview($parms = array()) {
$r = $this->frxReport; $r = $this->frxReport;
if(strpos($this->report_name, '__') !== 0) $r->preview_mode = TRUE; if(strpos($this->report_name, '__') !== 0) $r->preview_mode = TRUE;
return $this->report($parms, TRUE, TRUE); $content = $this->report($parms, TRUE, TRUE);
return $content;
} }
/** /**
......
...@@ -56,6 +56,9 @@ function forena_display_blocks() { ...@@ -56,6 +56,9 @@ function forena_display_blocks() {
function forena_data_block_preview($block_name, $parms = array(), $edit=FALSE) { function forena_data_block_preview($block_name, $parms = array(), $edit=FALSE) {
if (isset($_SESSION['forena_report_editor']['__forena_block_preview__'])) {
unset($_SESSION['forena_report_editor']['__forena_block_preview__']);
}
$o = Frx::Editor('__forena_block_preview__'); $o = Frx::Editor('__forena_block_preview__');
$o->frxReport->block_edit_mode = $edit; $o->frxReport->block_edit_mode = $edit;
$o->alterParameters($parms); $o->alterParameters($parms);
......
...@@ -652,6 +652,7 @@ function forena_parameter_form($formid, &$form_state, $parameters, $attributes= ...@@ -652,6 +652,7 @@ function forena_parameter_form($formid, &$form_state, $parameters, $attributes=
else { else {
extract($form_state['storage']); extract($form_state['storage']);
} }
$report_name = @$desc['name']; $report_name = @$desc['name'];
$collapse = isset($attributes['collapsed']) ? $attributes['collapsed'] : FALSE; $collapse = isset($attributes['collapsed']) ? $attributes['collapsed'] : FALSE;
if (isset($form_state['values'])) { if (isset($form_state['values'])) {
...@@ -661,7 +662,6 @@ function forena_parameter_form($formid, &$form_state, $parameters, $attributes= ...@@ -661,7 +662,6 @@ function forena_parameter_form($formid, &$form_state, $parameters, $attributes=
if (isset($form_state['storage']['menu-parms'])) { if (isset($form_state['storage']['menu-parms'])) {
$menu_parms = $form_state['storage']['menu-parms']; $menu_parms = $form_state['storage']['menu-parms'];
$parms = array_merge($menu_parms,$parms); $parms = array_merge($menu_parms,$parms);
} }
drupal_alter('forena_parameters', $report_name, $parms); drupal_alter('forena_parameters', $report_name, $parms);
Frx::Data()->push($parms, 'parm'); Frx::Data()->push($parms, 'parm');
...@@ -914,9 +914,10 @@ function forena_parameter_form_submit($form, &$form_state) { ...@@ -914,9 +914,10 @@ function forena_parameter_form_submit($form, &$form_state) {
$path = $desc['link']; $path = $desc['link'];
} }
else { else {
$path = $desc['q']; $path = isset($desc['q']) ? $desc['q'] : '';
} }
$form_state['redirect']= array($path, array('query' => @$values['params'])); if (!$path) $path=$_GET['q'];
if ($path) $form_state['redirect']= array($path, array('query' => @$values['params']));
} }
/** /**
......
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