From 128d8ce29c10895fe9fc3cce3216b3539ec2c0c8 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 16 Jul 2012 23:00:44 +0000 Subject: [PATCH] Make sure we get updated get_rows query in all cases --- .../inc/class.etemplate_widget_nextmatch.inc.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/etemplate/inc/class.etemplate_widget_nextmatch.inc.php b/etemplate/inc/class.etemplate_widget_nextmatch.inc.php index a9d7b2a48b..631ce87d45 100644 --- a/etemplate/inc/class.etemplate_widget_nextmatch.inc.php +++ b/etemplate/inc/class.etemplate_widget_nextmatch.inc.php @@ -98,12 +98,17 @@ class etemplate_widget_nextmatch extends etemplate_widget { $attrs = $this->attrs; $form_name = self::form_name($cname, $this->id, $expand); - $value =& self::get_array(self::$request->content, $form_name, true); + $value = self::get_array(self::$request->content, $form_name, true); $value['start'] = 0; $value['num_rows'] = self::INITIAL_ROWS; $value['rows'] = array(); - $value['total'] = self::call_get_rows($value, $value['rows'], self::$request->readonlys); + + $send_value = $value; + $total = self::call_get_rows($send_value, $send_value['rows'], self::$request->readonlys); + $value =& self::get_array(self::$request->content, $form_name, true); + $value = $send_value; + $value['total'] = $total; // Send categories if(!$value['no_cat'] && !$value['cat_is_select']) @@ -134,6 +139,11 @@ class etemplate_widget_nextmatch extends etemplate_widget //unset($value[$name]); } } + if($value['rows']['sel_options']) + { + self::$request->sel_options = array_merge(self::$request->sel_options,$value['rows']['sel_options']); + unset($value['rows']['sel_options']); + } // todo: no need to store rows in request, it's enought to send them to client @@ -370,7 +380,7 @@ class etemplate_widget_nextmatch extends etemplate_widget if (is_null($first)) $first = $n; $rows[$n-$first+$value['start']] = $row; } - elseif(!is_null($first)) // rows with string-keys, after numeric rows + elseif(!is_numeric($n)) // rows with string-keys, after numeric rows { $rows[$n] = $row; }