I am currently trying to use views php to filter certain rows from my view. The problem that I am having is that the given variables do not contain the correct values of the fields. They only return what I believe to be the view id. Can anyone tell me how I can retrieve the values of the fields, including cck fields, into the filter so that I can use them to filter my view.

I figured out how to do it in the php field by extracting the values from the $data variable. Unfortunately, that does not seem to work in the filter.

I am using Drupal 7.4 with the latest dev versions of everything that I currently have installed. Also, this problem is true for any field, cck and otherwise.

Comments

Tschet’s picture

I'd love to know the answer to this. I'm seeing the similar results. In both the PHP filter, and PHP Field I'm getting the Node ID rather than the value of the field.

johnv’s picture

Status: Active » Closed (duplicate)

For retrieving the correct data, please follow #1140896: Variable $row does not contain correct values ($data->_field_data does)
You can use the following as a work-around: $data->_field_data

And if you have found your data, PHP filter won't work either: #1222448: Views PHP Can't Filter