Commit f314ae0c authored by jcnventura's avatar jcnventura

When there's no alias defined, link to print*/nid and not print*/node/nid.

parent 2a94de3a
......@@ -341,8 +341,8 @@ function print_link($type, $node = NULL, $teaser = FALSE) {
$query = print_query_string_encode($query_arr, array('q'));
if (empty($query)) $query = NULL;
if ($print_html_link_use_alias) {
$path = drupal_get_path_alias('node/'. $node->nid);
if (($print_html_link_use_alias) && ($alias = drupal_lookup_path('alias', 'node/'. $node->nid))) {
$path = $alias;
}
else {
$path = $node->nid;
......@@ -731,8 +731,8 @@ function print_insert_link($path = NULL, $node = NULL) {
$path = 'book/export/html/'. $nid;
}
else {
if (variable_get('print_html_link_use_alias', PRINT_HTML_LINK_USE_ALIAS_DEFAULT)) {
$path = drupal_get_path_alias($path);
if (variable_get('print_html_link_use_alias', PRINT_HTML_LINK_USE_ALIAS_DEFAULT) && ($alias = drupal_lookup_path('alias', $path))) {
$path = $alias;
}
else {
$path = $nid;
......
......@@ -159,8 +159,8 @@ function print_mail_link($type, $node = NULL, $teaser = FALSE) {
$query = print_query_string_encode($query_arr, array('q'));
if (empty($query)) $query = NULL;
if ($print_mail_link_use_alias) {
$path = drupal_get_path_alias('node/'. $node->nid);
if (($print_mail_link_use_alias) && ($alias = drupal_lookup_path('alias', 'node/'. $node->nid))) {
$path = $alias;
}
else {
$path = $node->nid;
......@@ -407,8 +407,8 @@ function print_mail_insert_link($path = NULL, $node = NULL) {
$path = 'book/export/html/'. $nid;
}
else {
if (variable_get('print_mail_link_use_alias', PRINT_MAIL_LINK_USE_ALIAS_DEFAULT)) {
$path = drupal_get_path_alias($path);
if (variable_get('print_mail_link_use_alias', PRINT_MAIL_LINK_USE_ALIAS_DEFAULT) && ($alias = drupal_lookup_path('alias', $path))) {
$path = $alias;
}
else {
$path = $nid;
......
......@@ -291,8 +291,8 @@ function print_pdf_link($type, $node = NULL, $teaser = FALSE) {
$query = print_query_string_encode($query_arr, array('q'));
if (empty($query)) $query = NULL;
if ($print_pdf_link_use_alias) {
$path = drupal_get_path_alias('node/'. $node->nid);
if (($print_pdf_link_use_alias) && ($alias = drupal_lookup_path('alias', 'node/'. $node->nid))) {
$path = $alias;
}
else {
$path = $node->nid;
......@@ -492,8 +492,8 @@ function print_pdf_insert_link($path = NULL, $node = NULL) {
$path = 'book/export/html/'. $nid;
}
else {
if (variable_get('print_pdf_link_use_alias', PRINT_PDF_LINK_USE_ALIAS_DEFAULT)) {
$path = drupal_get_path_alias($path);
if (variable_get('print_pdf_link_use_alias', PRINT_PDF_LINK_USE_ALIAS_DEFAULT) && ($alias = drupal_lookup_path('alias', $path))) {
$path = $alias;
}
else {
$path = $nid;
......
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