There seems to be a bug in print.module when current page only setting is enabled.

The line in question (351) reads:

$path = ($print_html_link_use_alias && isset($node->path)) ? $node->path : $node->nid;

Meanwhile, $node is not exposed to print_node_view_alter().

My solution was to user $build['#node'] instead, so the line reads

$path = ($print_html_link_use_alias && isset($build['#node']->path)) ? $build['#node']->path : $build['#node']->nid;

Not sure if it's correct though, so no patch for now.

Comments

jcnventura’s picture

Status: Active » Fixed

Indeed, I hadn't yet tested that option in the D7 version..

Thanks for reporting the problem! I've fixed it in git now.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Adding line number.