From fb9d6db5bebaa94ec9016df76d09de7891683b9d Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 27 Nov 2007 21:24:50 +0000 Subject: [PATCH] "fixed so_sql::get_rows to return an empty array() instead of array(false) if nothing found" --- etemplate/inc/class.so_sql.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etemplate/inc/class.so_sql.inc.php b/etemplate/inc/class.so_sql.inc.php index b05c3c2094..d8ed037ceb 100644 --- a/etemplate/inc/class.so_sql.inc.php +++ b/etemplate/inc/class.so_sql.inc.php @@ -837,9 +837,11 @@ class so_sql $criteria[$col] = $query['search']; } } - $rows = (array) $this->search($criteria,false,$query['order']?$query['order'].' '.$query['sort']:'', + $rows = $this->search($criteria,false,$query['order']?$query['order'].' '.$query['sort']:'', '','%',false,'OR',$query['num_rows']?array((int)$query['start'],$query['num_rows']):(int)$query['start'], $query['col_filter'],$join,$need_full_no_count); + + if (!$rows) $rows = array(); // otherwise false returned from search would be returned as array(false) return $this->total; }