Skip to content

Commit

Permalink
#211: Bug if use where clause and try to "search all" the fields
Browse files Browse the repository at this point in the history
  • Loading branch information
scoumbourdis committed Dec 10, 2017
1 parent ae511bd commit 3716961
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions application/libraries/Grocery_CRUD.php
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ protected function set_ajax_list_queries($state_info = null)
$this->basic_model->having($where[0],$where[1],$where[2]);

$temp_where_query_array = [];
$basic_table = $this->get_table();

foreach($columns as $column)
{
Expand Down Expand Up @@ -673,7 +674,7 @@ protected function set_ajax_list_queries($state_info = null)
!in_array($field_types[$column->field_name]->type, array('date', 'datetime', 'timestamp'))
) {
$escaped_text = $this->basic_model->escape_str($search_text);
$temp_where_query_array[] = $column->field_name . ' LIKE \'%' . $escaped_text . '%\'';
$temp_where_query_array[] = '`' . $basic_table . '`.' . $column->field_name . ' LIKE \'%' . $escaped_text . '%\'';
}
}

Expand Down Expand Up @@ -2194,8 +2195,10 @@ protected function get_layout()
}
elseif($this->echo_and_die === true)
{
echo $this->views_as_string;
die();
return (object)array(
'isAjax' => true,
'output' => $this->views_as_string,
);
}
}

Expand Down
1 change: 1 addition & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
v 1.6.0
- #211: Bug if use where clause and try to "search all" the fields
- #432: Bootstrap Theme issues with filtering when we are using set_relation with multiple fields
- #353: Adding callback_read_field function
- #433: Preview click with fancybox to work the same across all the themes
Expand Down

0 comments on commit 3716961

Please sign in to comment.