Closed (outdated)
Project:
Views PHP
Version:
6.x-1.x-dev
Component:
Filter Handler
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Aug 2011 at 20:28 UTC
Updated:
8 Feb 2021 at 23:23 UTC
Jump to comment: Most recent
Comments
Comment #1
lekvarnik commentedI have solved it by incuding the huge flter code from Global PHP field into filter.
Because for some reason it is not accepting the $raw->php
I think it is a bug or something.
Comment #2
drupalnesia commentedBelow code doesn't work on D6, "$row->php" is my Global PHP that I what to use.
Is it a bug?
Comment #3
greggmarshallI'm pretty sure I'm seeing the same thing.
Using views_php version 6.x-1.x-dev with a date stamp of 1308745781 and views version 6.x-3.0-alpha4.
If the "Filter code:" block is empty, I get all the rows as expected.
If the "Filter code:" block contains
return TRUE:
I get nothing which is what I guess I would expect based on the description under that block
If the code returns TRUE the current row is removed from the results. Do not use < ? p h p ? > delimiters.
If the "Filter code:" block contains
return FALSE:
I still get nothing which is not what I would expect.
Comment #4
greggmarshallTracing this further, it looks like anything in the "Filter Code:" field causes all the rows to disappear.
The code in views_php_handler_filter.inc appears to be executing correctly. I put a dpm into the code at line 126 and it outputs if I set the Filter Code to return TRUE and doesn't if I set the Filter Code to return FALSE. But no rows are output.
Remove the code in the field and the rows reappear.
So I've tried:
In all three cases the rows disappear.
Next I tried commenting out the code between lines 112 to 131, which effectively removes the processing of that field. Still NO rows.
With the code commented out, if I clear the Filter Code field, the rows reappear.
I'm starting to believe the field is having some side effect I don't understand. And I'm not sure where to look next. Any ideas anyone?
Comment #5
webservant316 commentedsubscribe
Same problem - filter appears to not be working. no rows displayed whether I return TRUE or FALSE.
Hey this is a pretty old post. Is this module still under active maintenance?
This module is very cool and useful. How can I help to get this fixed?
Changing priority to major.
Comment #6
webservant316 commentedI back pedaled to views_customfield because this module doesn't work.
I also noticed that the disable and uninstall doesn't remove the presence of views_php from views.
Comment #7
stefan81 commentedas described in #5,
what ever is returned, it is ignored.
Any Ideas / progress on this?
Comment #8
webservant316 commentedregarding #6 - I did back pedal and after disabling and uninstalling I also needed to clear my cache and then views_php was fully removed.
Comment #9
stefan81 commentedHi webservant316,
Thanks for your imput.
However I would like to stick with this module, as to many things are already made with it.
Comment #10
stefan81 commentedI am using views 3.
Could this be the problem?
Comment #11
webservant316 commentedI would be glad to except for these problem...
1. views_php has a filter option which I need, but the return value is currently ignored. I made a simply filter with return TRUE; and return FALSE; and in both cases behavior was return FALSE; So until this is fixed views_php has little advantage over views_customfield.
2. Further, $value, $data, and $php are not properly assigned in the field definitions either. I added this code to my views_php field definition
error_log("TEST: " . print_r($value,TRUE) . print_r($php,TRUE) . print_r($data,TRUE),0);and all three variables had null values (at places) when they should have been populated. However, the $data array was properly assigned in views_customfield.Give those major problem, php_customfield at least works for now. I will move back to views_php as soon as the above are fixed because I really do need the filter capability.
Comment #12
wasare commentedI had the same trouble with views 3. My workaround was use the hook_views_pre_render into a custom module to adjust the filter.
Comment #12.0
wasare commentedecho to echos
Comment #13
liam morlandDrupal 6 is no longer supported. If this applies to a later version, please re-open and update the version.