Open falkartis opened 6 years ago
Hello @falkartis can you please describe exactly what the problem is? When are you getting this error and with which theme?
Yes, I see the description is quite short, I'm sorry for that.
The problem appears when in one page you use a filter on the search field (on the bottom) for a specific column and then you change to another page which doesn't have that column.
In my case php spits out two notices saying Undefined index: search_field
.
The theme is flexigrid.
i believe this this bug: https://github.com/scoumbourdis/grocery-crud/commit/9d16ab5c98f765dca4a9127ce78d93d06e7f45ef
when empty($data['search_field']) $search_text = ''; //<----- suggest change to this? cos impossible to get $data['search_field'] when is empty ; - /
I changed search_field
to search_text
and it made the job. I didn't read the whole file to understand what is going on behind the scenes, I just trusted my intuition.
First $data['search_field']
must be Undefined because of the if statement.
And second if the variable being assigned is $search_text
it seems obvious to me that the key should also be search_text
.
I created this issue because I was not sure enough to create a pull request and all that stuff.
https://github.com/scoumbourdis/grocery-crud/blob/d2f71fba0e564bacec23990cd00497f1ed4d7741/application/libraries/Grocery_CRUD.php#L3235
I'm not sure about if this is the right solution but the idea is: Change search_field with search_text