Closed (fixed)
Project:
Views PDF
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Mar 2012 at 21:28 UTC
Updated:
6 Mar 2013 at 07:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
njcheng commentedAh! It appears to come from line 450 of views_pdf_template.php:
The above code assume that $options['text']['font_size'] is not set, however it is set to an empty string.
I'm not sure, however, if it may be actually unset under certain conditions so until I hear from the module developer about the intended behavior before submitting a patch.
Comment #2
ontwerphuis commentedHi I'm experiencing the same issue. I can see the pdf background with the lables but no data. How did you fix this ?
Thank you
Comment #3
gillarf commentedSame here - if this is causing the problem, surely this is an easy fix?
Comment #4
alyssaengleson@aimclear.com commentedI was able to fix this by replacing:
$font_size = !isset($options['text']['font_size']) ? $this->defaultFontSize : $options['text']['font_size'] ;
with:
$font_size = !isset($options['text']['font_size']) ? $options['text']['font_size'] : $this->defaultFontSize ;
on line 450 of views_pdf_template.php
Comment #5
2phaI changed it to:
$font_size = isset($options['text']['font_size']) ? $options['text']['font_size'] : $this->defaultFontSize ;
Comment #6
saturnino commentedOk that's worked for me.
thank you !
Comment #7
simon georges commentedFor those who are looking for automated installation using drush make, I'm proposing the following patch. Please review.
Comment #8
lsolesen commentedThis patch fixed the problem for me #1794450: Line items not shown on the pdf
Comment #9
ram4nd commented#7 worked for me. Thank you. I wonder when views_pdf module gets patched with this.
Comment #10
garphyI would have both tested !isset() and empty() avoid possible warnings about an uninitialized array key. However, #7 does the trick.
Comment #11
simon georges commentedFrom PHP doc: empty() does not generate a warning if the variable does not exist, empty() is essentially the concise equivalent to !isset($var) || $var == false. So I don't see the point in adding another
!isset().Comment #12
garphyIndeed ! Thanks for clarifying this point :) I'll go tidy up some if() :)
Comment #13
simon georges commentedCommitted to 1.x-dev version. Everybody, thanks for all your suggestions and reviews!