Hi guys,
I've been testing this module for a custom search form of mine for a live site.
Problem is, everytime I create this filter, it returns me the following line in the page no matter what I do:
"Parse error: syntax error, unexpected $end, expecting '(' in /home/qotion/public_html/modules/viewsphpfilter/viewsphpfilter.module(57) : eval()'d code on line 1"
Before going on, I must mention that I did the following:
- Removed any and tags as per the instructions in readme
- Tested the field by leaving the value of the PHP field blank
- Made sure the Node:Node ID filter is set to "PHP code" rather than list
- Created a simple test array e.g. $array[] = 123, and returned it
- Tried with the tags attached
... Nothing seems to get rid of that error. Then I exposed the filter, and tried the test array again.
This time it worked perfectly. Problem is, I don't want to expose this filter at all. Wondering if anyone knows what the problem is. It's been a really frustrating afternoon for me so I'll really appreciate any help I can get @.@
The test script is as follows:
$array[] = 2054;
$array[] = 2058;
return $array;
Comments
Comment #1
gnassar commentedWell, you helped me find a bug -- but it was with PHP strings with commas in them, in Drupal 5. Apparently if the field contents have a comma, something is parsing that out into an array before storing it. Problem doesn't exist in Drupal 6/Views 2.
As for your specific problem, though, I can't seem to duplicate it even with the same test string. (I changed the numbers so they'd match node IDs I had in my DB.) Exposing seemed to make no difference. (Understandable that you wouldn't want to do that -- I can't think of a case where exposing this filter is a *good* idea.)
A commit is in CVS to fix the first problem. Once that pushes across to the dev build, you can give that one a shot and see if it helps your problem any.
Fingers crossed!
Comment #2
WildfireXT commentedIt worked great!
Thanks for the prompt response man, really saved my bacon on this one.
This is exactly the module I was looking for in Views filters, so it'll have been a shame if I couldn't make use of it.
Cheers for a great module.
Comment #3
gnassar commentedGreat to hear. Marking as fixed.