Commit 4034f91c authored by jcnventura's avatar jcnventura

Issue #1044138: fix PDF filename token replacement.

parent 2a46e42c
......@@ -29,6 +29,19 @@ function print_pdf_controller() {
$path = implode('/', $args);
$cid = isset($_GET['comment']) ? (int)$_GET['comment'] : NULL;
if (ctype_digit($args[0])) {
if (drupal_lookup_path('source', $path)) {
// This is a numeric alias
$path = drupal_get_normal_path($path);
$path_arr = explode('/', $path);
$node = node_load($path_arr[1]);
}
else {
// normal nid
$node = node_load($args[0]);
}
}
$pdf_filename = variable_get('print_pdf_filename', PRINT_PDF_FILENAME_DEFAULT);
if (!empty($pdf_filename)) {
$pdf_filename = token_replace($pdf_filename, array('node' => $node)) . '.pdf';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment