}
if (!empty($fields)) {
foreach($fields as $field) {
- $searchfield = data_get_field_from_id($field, $data);
+ $searchfield = data_get_field_from_id($field->id, $data);
//Get field data to build search sql with. If paging is false, get from user.
//If paging is true, get data from $search_array which is obtained from the $SESSION (see line 116).
if(!$paging) {
if ($mode == 'single') { // Single template
$baseurl = 'view.php?d=' . $data->id . '&mode=single&';
- $search && $baseurl .= 'filter=1&';
+ if (!empty($search)) {
+ $baseurl .= 'filter=1&';
+ }
print_paging_bar($totalcount, $page, $nowperpage, $baseurl, $pagevar='page');
if (empty($data->singletemplate)){
$baseurl = 'view.php?d='.$data->id.'&';
//send the advanced flag through the URL so it is remembered while paging.
$baseurl .= 'advanced='.$advanced.'&';
- $search && $baseurl .= 'filter=1&';
+ if (!empty($search)) {
+ $baseurl .= 'filter=1&';
+ }
//pass variable to allow determining whether or not we are paging through results.
$baseurl .= 'paging='.$paging.'&';