Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined index: search_field #446

Open
falkartis opened this issue Apr 14, 2018 · 5 comments
Open

Undefined index: search_field #446

falkartis opened this issue Apr 14, 2018 · 5 comments

Comments

@falkartis
Copy link

$search_text = strip_tags($data['search_field']);

I'm not sure about if this is the right solution but the idea is: Change search_field with search_text

@scoumbourdis
Copy link
Owner

Hello @falkartis can you please describe exactly what the problem is? When are you getting this error and with which theme?

@falkartis
Copy link
Author

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.

@alzen8work
Copy link

i believe this this bug:
9d16ab5

@alzen8work
Copy link

when empty($data['search_field'])
$search_text = ''; //<----- suggest change to this? cos impossible to get $data['search_field'] when is empty ; - /

@falkartis
Copy link
Author

falkartis commented May 6, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants