summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoao Ventura2012-04-18 23:31:52 (GMT)
committerJoao Ventura2012-04-18 23:31:52 (GMT)
commitf314ae0cc94f333083a80e76ca182aa6046df398 (patch)
tree1123e974168dd2abe3ec4739357918f174cfeca4
parent2a94de3a169c622ef0174bc73361bcd4459cdcd5 (diff)
When there's no alias defined, link to print*/nid and not print*/node/nid.6.x-1.16
-rw-r--r--print.module8
-rw-r--r--print_mail/print_mail.module8
-rw-r--r--print_pdf/print_pdf.module8
3 files changed, 12 insertions, 12 deletions
diff --git a/print.module b/print.module
index 194c311..9507610 100644
--- a/print.module
+++ b/print.module
@@ -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;
diff --git a/print_mail/print_mail.module b/print_mail/print_mail.module
index 752d10e..60af70d 100644
--- a/print_mail/print_mail.module
+++ b/print_mail/print_mail.module
@@ -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;
diff --git a/print_pdf/print_pdf.module b/print_pdf/print_pdf.module
index a88f454..04605d1 100644
--- a/print_pdf/print_pdf.module
+++ b/print_pdf/print_pdf.module
@@ -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;