From 33d617aa8f8d32a3eb8c53e7f1da9eb5a96e701f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 13 Nov 2008 16:55:03 +0000 Subject: [PATCH] "stop storing rows content in session by using an empty new var $rows in calling the get_rows funktion: get_rows($value,$rows,$readonlys) instead get_rows($value,$value['rows'],$readonlys) because $values['rows'] as reference would be stored in the session, when apps store $query parameter in the session " --- etemplate/inc/class.nextmatch_widget.inc.php | 26 +++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/etemplate/inc/class.nextmatch_widget.inc.php b/etemplate/inc/class.nextmatch_widget.inc.php index f0e3a31f68..ccd3531afe 100644 --- a/etemplate/inc/class.nextmatch_widget.inc.php +++ b/etemplate/inc/class.nextmatch_widget.inc.php @@ -261,6 +261,7 @@ class nextmatch_widget } } // save values in persistent extension_data to be able use it in post_process + unset($value['rows']); $extension_data += $value; $value['no_csv_export'] = $value['csv_fields'] === false || @@ -308,6 +309,7 @@ class nextmatch_widget // presetting the options for selectcols empty, so the get_rows function can set it $value['options-selectcols'] = array(); } + $rows = array(); if (!is_object($obj) || !method_exists($obj,$method)) { $GLOBALS['egw_info']['etemplate']['validation_errors'][$name] = "nextmatch_widget::pre_process($cell[name]): '$value[get_rows]' is no valid method !!!"; @@ -315,24 +317,26 @@ class nextmatch_widget else { if (!is_array($readonlys)) $readonlys = array(); - $total = $extension_data['total'] = $value['total'] = $obj->$method($value,$value['rows'],$readonlys['rows']); - - // allow the get_rows function to override / set sel_options - if (isset($value['rows']['sel_options']) && is_array($value['rows']['sel_options'])) - { - $tmpl->sel_options = array_merge($tmpl->sel_options,$value['rows']['sel_options']); - unset($value['rows']['sel_options']); - } + $total = $extension_data['total'] = $value['total'] = $obj->$method($value,$rows,$readonlys['rows']); } if ($method && $total && $value['start'] >= $total) { $value['start'] = 0; - $total = $extension_data['total'] = $value['total'] = $obj->$method($value,$value['rows'],$readonlys['rows']); + $total = $extension_data['total'] = $value['total'] = $obj->$method($value,$rows,$readonlys['rows']); } - if (is_array($value['rows'][0])) // fixed 0 based arrays + // allow the get_rows function to override / set sel_options + if (isset($rows['sel_options']) && is_array($value['rows']['sel_options'])) { - array_unshift($value['rows'],false); + $tmpl->sel_options = array_merge($tmpl->sel_options,$rows['sel_options']); + unset($rows['sel_options']); } + if (is_array($rows[0])) // fixed 0 based arrays + { + array_unshift($rows,false); + } + $value['rows'] =& $rows; + unset($rows); + list($template,$options) = explode(',',$cell['size']); if (!$value['template'] && $template) // template name can be supplied either in $value['template'] or the options-field {