When a node title includes a special character such as an apostrophe, the printer-friendly and PDF that is auto-generated from the node renders the apostrophe using HTML encoding (')

The node body is rendered correctly, this just affects the title.

I'm not sure this is the best solution, but calling html_entity_decode on the check_plained version of the title works.

--- a/print.pages.inc
+++ b/../print_new/print.pages.inc
@@ -168,7 +168,7 @@ function print_preprocess_print(&$variables) {
$variables['url'] = url($path, array('absolute' => TRUE, 'query' => $variables['query']));
$variables['source_url'] = url(variable_get('print_sourceurl_forcenode', PRINT_SOURCEURL_FORCENODE_DEFAULT) ? drupal_get_normal_path($path) : $path, array('alias' => TRUE, 'absolute' => TRUE, 'query' => $variables['query']));
$variables['cid'] = isset($node->cid) ? $node->cid : NULL;
- $variables['print_title'] = check_plain($node->title);
+ $variables['print_title'] = html_entity_decode(check_plain($node->title));
$variables['head'] = drupal_get_html_head();
$variables['robots_meta'] = _print_robots_meta_generator();

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bart atlas created an issue. See original summary.

bart atlas’s picture

Status: Active » Needs review
Nitesh Sethia’s picture

Assigned: bart atlas » Unassigned
FileSize
1.87 KB

Creating a patch for the same.

kyoder’s picture

FileSize
616 bytes

Here's an updated version of the patch.

  • RenatoG committed ee52fc6 on 7.x-2.x authored by kyoder
    Issue #2728885 by Nitesh Sethia, kyoder, bart atlas, RenatoG: Print...
renatog’s picture

Status: Needs review » Fixed

Moved to the dev branch. Thanks a lot

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.