summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoao Ventura2011-10-13 11:36:37 (GMT)
committer Joao Ventura2011-10-13 11:36:37 (GMT)
commitb80ad20f5fccb75f82202c6acdd00e0f29df4707 (patch)
tree1a20a7421ca70e73388925b77539c65f75919938
parentf7f4b1d95439c0132794e5122bfec25cd706e49b (diff)
Issue #1222198: fix error when node->path is an array.
-rw-r--r--print.pages.inc6
-rw-r--r--print_mail/print_mail.inc2
-rw-r--r--print_pdf/print_pdf.pages.inc4
3 files changed, 6 insertions, 6 deletions
diff --git a/print.pages.inc b/print.pages.inc
index 1ab082c..c54a34e 100644
--- a/print.pages.inc
+++ b/print.pages.inc
@@ -30,14 +30,14 @@ function print_controller_html() {
drupal_send_headers();
print $html;
- $nodepath = (isset($node->path)) ? drupal_get_normal_path($node->path) : 'node/' . $path;
+ $nodepath = (isset($node->path) && is_string($node->path)) ? drupal_get_normal_path($node->path) : 'node/' . $path;
db_merge('print_page_counter')
->key(array('path' => $nodepath))
->fields(array(
'totalcount' => 1,
'timestamp' => REQUEST_TIME,
))
- ->expression('totalcount', 'totalcount + :inc', array(':inc' => 1))
+ ->expression('totalcount', 'totalcount + 1')
->execute();
}
}
@@ -81,7 +81,7 @@ function print_controller($path, $cid = NULL, $format = PRINT_HTML_FORMAT, $teas
$path = $alias;
}
$parts = explode('/', $path);
- if ($parts[0] == 'node') {
+ if (($parts[0] == 'node') && (count($parts) > 1)) {
array_shift($parts);
$path = implode('/', $parts);
}
diff --git a/print_mail/print_mail.inc b/print_mail/print_mail.inc
index c728b76..6bb612e 100644
--- a/print_mail/print_mail.inc
+++ b/print_mail/print_mail.inc
@@ -62,7 +62,7 @@ function print_mail_form($form, &$form_state) {
'totalcount' => 1,
'timestamp' => REQUEST_TIME,
))
- ->expression('totalcount', 'totalcount + :inc', array(':inc' => 1))
+ ->expression('totalcount', 'totalcount + 1')
->execute();
}
diff --git a/print_pdf/print_pdf.pages.inc b/print_pdf/print_pdf.pages.inc
index b07f5c6..6f78f5c 100644
--- a/print_pdf/print_pdf.pages.inc
+++ b/print_pdf/print_pdf.pages.inc
@@ -54,14 +54,14 @@ function print_pdf_controller() {
exit;
}
- $nodepath = (isset($node->path)) ? drupal_get_normal_path($node->path) : 'node/' . $path;
+ $nodepath = (isset($node->path) && is_string($node->path)) ? drupal_get_normal_path($node->path) : 'node/' . $path;
db_merge('print_pdf_page_counter')
->key(array('path' => $nodepath))
->fields(array(
'totalcount' => 1,
'timestamp' => REQUEST_TIME,
))
- ->expression('totalcount', 'totalcount + :inc', array(':inc' => 1))
+ ->expression('totalcount', 'totalcount + 1')
->execute();
}