Nice module. The php code runs however none of the values are available. The following is printed out:
Array
(
[args] =>
[field] =>
[row] =>
[rows] =>
[output] =>
[field_name] =>
[row_index] =>
)
(all blanks). The views formatted fields is the last field in the view. Am I doing something wrong? I am using the PHP Code input filter.
Comments
Comment #1
sidharth_k commentedThe above is for PHP code...
Comment #2
sidharth_k commentedComment #3
drawk commentedSame issue here.
Comment #4
peguca commentedHaving the same issue here
Comment #5
Jackinloadup commentedSame here.. Subscribing
Comment #6
ibis commentedSame here.. Subscribing, but here is the previous version which support only PHP code ( http://drupal.org/node/441488#comment-1714722 ) and this work perfectly.
Comment #7
Gerald Mengisen commentedSame problem as above (no surprise); I had more luck with Views Custom Field once I read this thread.
Comment #8
Dasha_V - old commentedUse this:
Comment #9
pfharlock commentedThe fix posted in #8 did the trick for me. Is there any chance we can get this change rolled into the mainline program?
Comment #10
Anonymous (not verified) commented#8 did not fix this for me, it just made views give me an error message when it tried to render it.
Seriously, I would think the owner of this module would care enough to get this resolved, considering so many people have this problem.
Comment #11
Anonymous (not verified) commentedFor those following this, what you're looking for in post #7 is the views_php_extension.zip file, install it like a regular module.
The test code in post#8 to print the available data in the arrays doesn't work with the views_php_extension module, but putting regular PHP in it does work, which is ultimately the point, so it does work :) Not perfect though ;)
I still wish the actual official module worked though.
Comment #12
betoaveigaTHANKS A LOOOOOT DASHA!!!! :)
Comment #13
vacilando commentedSame problem, subscribing.
Comment #14
freeform.steph commentedI also received an error when trying the suggestion in #8, and after much searching I found no way of making the variables available for use with this module.
As suggested in #7, what worked for me was the customfield module (http://drupal.org/project/views_customfield). This module provides 3 field options: PHP code, Markup, and rownumber. This module is not perfect though.
The Markup option allows you to use one of your site's defined input filters, which is great if you need access to a special filter for use with another module, however the Markup option, like Views Formatted Field, does not appear to provide access to the available variables.
In contrast, the PHP code option does allow you access to the variables, but does not allow you access to input filters. Combine these two options and you'd have a killer module, but for now, I am submitting to the limitations.
If you need to find out the variables that are available to you for this field, you can enter
print_r($data);and run a preview of your view.Comment #15
edrauta commentedSame problem, subiscribing, and don't work #8
Comment #16
Vote_Sizing_Steve commented#8 worked for me - thanks.
Comment #17
off commentedSame issue
Comment #18
Vote_Sizing_Steve commentedFix #8 worked for a long time, but I'm now getting a:
warning: extract() [function.extract]: First argument should be an array in ...
... error...
**Update** Never mind this post, I was generating the error because I was running #8 on a Customfield: PHP code field.