Closed (duplicate)
Project:
Views PDF
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Feb 2012 at 16:53 UTC
Updated:
20 Nov 2012 at 14:57 UTC
I noticed that using the option to add php code before and after printing a cell didn't work in the latest dev version.
The problem is php_eval(). When I replaced php_eval() with the standard eval() it worked.
Change line 481 from:
php_eval($options['render']['eval_before']);
to:
eval($options['render']['eval_before']);
And line 511 from:
php_eval($options['render']['eval_after']);
to:
eval($options['render']['eval_after']);
Comments
Comment #1
pomliane commentedComment #2
Robin Millette commentedIt would probably be best to fix the module to work with the php_eval() wrapper function.
There are very good reasons to use Drupal's PHP wrapper functions.
Comment #3
ellen.davis commentedphp_eval documentation says it "prevents the code being evaluated from overwriting variables in the code that called it"
But, by looking at some scripts that have been posted, it looks like they do exactly that - overwrite variables in the code.
So, maybe a permission is needed.
But, I guess it would be more complicated than that. The form should not even be displayed unless you have the 'use PHP in before/after' permission.
Comment #4
kevster commentedI have also come across this problem with latest dev version - I cannot get anything to display in PHP before and after.
I also get a "This operation is not allowed" Adobe PDF document popup when trying to view the PDF.
Thx..
Comment #5
lsolesen commentedNo patch to work on, so changing to active.
Comment #6
s.daniel commentedhttp://drupal.org/node/1513490#comment-6741102