Closed (fixed)
Project:
Printer, email and PDF versions
Version:
6.x-1.17
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Jun 2012 at 07:15 UTC
Updated:
18 Aug 2012 at 11:23 UTC
After upgrading from version 6.x-1.14 to 6.x-1.17 PDF pages are empty or an error message is displayed (depending on the PHP error_reporting setting) if the Token module is not enabled in a drupal 6.x site.
I think the reason for the problem lies in the following code block in print_pdf/print_pdf.pages.inc (line 42):
if (function_exists('token_replace') && !empty($pdf_filename) && !empty($node)) {
$pdf_filename = token_replace($pdf_filename, 'node', $node);
}
else {
$pdf_filename = token_replace($pdf_filename, 'global');
if (empty($pdf_filename) || count(token_scan($pdf_filename))) {
// If there are still tokens, use a fallback solution
$pdf_filename = str_replace('/', '_', $path);
}
}
The if condition tests for the existence of the function 'token_replace' but the else branch also users this function wich leads to an error.
After installing and enabling the Token module the PDF pages are displayed correct (with the current developer version of the print module).
Comments
Comment #1
jcnventuraWell spotted, thanks for the bug report.
Comment #2
jcnventurahttp://drupalcode.org/project/print.git/commit/b1bfac7
Comment #4
Franz- commentedmaybe fixed in git, but not in the downloadable 6.17, at least I get a failure message without token module (which I loaded now only for the PDFs)