I've created a view and added a php filter and added : return TRUE; to the filter code. It says that if it returns true the row will be removed from the results, therefore if every row returns TRUE, no results should be displayed.

It makes no difference for me, I get all results returned.

Am I missing something obvious here?

Comments

iancawthorne’s picture

This is possibly related to the type of view. I can now get this working ok with a content view, but I am using search api and have a "node index" view. The php filter is available, which would suggest it should work, but it appears it does not.

johnv’s picture

Status: Active » Closed (duplicate)

Hi, this is already reported in #1222448: Views PHP Can't Filter

iancawthorne’s picture

Status: Closed (duplicate) » Active

I don't think this is a duplicate. Issue #1222448 relates to a node type view, which I can get working fine.

For example on a node type view, you can enter return TRUE or FALSE as the only code for the php filter and can see that it works.

In this case for a search_api view, the same code makes no difference.

johnv’s picture

@iancawthorne, OK. on my system, filter doesn't work for a node view either...

johnv’s picture

Title: views_php filter does nothing » views_php Filter handler does nothing
Status: Active » Closed (duplicate)
johnv’s picture

Issue summary: View changes

Typo corrected.