summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--print.module7
-rw-r--r--print_mail/print_mail.module7
-rw-r--r--print_pdf/print_pdf.module7
3 files changed, 18 insertions, 3 deletions
diff --git a/print.module b/print.module
index 77d17c7..5416f1d 100644
--- a/print.module
+++ b/print.module
@@ -339,7 +339,12 @@ function print_form_alter($form_id, &$form) {
* node to be modified
*/
function _print_set_node_fields(&$node) {
- $res = db_fetch_object(db_query("SELECT link, comments, url_list FROM {print_node_conf} WHERE nid = %d", $node->nid));
+ if (isset($node->nid)) {
+ $res = db_fetch_object(db_query("SELECT link, comments, url_list FROM {print_node_conf} WHERE nid = %d", $node->nid));
+ }
+ else {
+ $res = FALSE;
+ }
$node->print_display = $res ? intval($res->link) : PRINT_TYPE_SHOW_LINK_DEFAULT;
$node->print_display_comment = $res ? intval($res->comments) : PRINT_TYPE_COMMENT_LINK_DEFAULT;
$node->print_display_urllist = $res ? intval($res->url_list) : PRINT_TYPE_URLLIST_DEFAULT;
diff --git a/print_mail/print_mail.module b/print_mail/print_mail.module
index adb1ee6..809998e 100644
--- a/print_mail/print_mail.module
+++ b/print_mail/print_mail.module
@@ -239,7 +239,12 @@ function print_mail_form_alter($form_id, &$form) {
* node to be modified
*/
function _print_mail_set_node_fields(&$node) {
- $res = db_fetch_object(db_query("SELECT link, comments, url_list FROM {print_mail_node_conf} WHERE nid = %d", $node->nid));
+ if (isset($node->nid)) {
+ $res = db_fetch_object(db_query("SELECT link, comments, url_list FROM {print_mail_node_conf} WHERE nid = %d", $node->nid));
+ }
+ else {
+ $res = FALSE;
+ }
$node->print_mail_display = $res ? intval($res->link) : PRINT_TYPE_SHOW_LINK_DEFAULT;
$node->print_mail_display_comment = $res ? intval($res->comments) : PRINT_TYPE_COMMENT_LINK_DEFAULT;
$node->print_mail_display_urllist = $res ? intval($res->url_list) : PRINT_TYPE_URLLIST_DEFAULT;
diff --git a/print_pdf/print_pdf.module b/print_pdf/print_pdf.module
index 14ad58f..eabd059 100644
--- a/print_pdf/print_pdf.module
+++ b/print_pdf/print_pdf.module
@@ -275,7 +275,12 @@ function print_pdf_form_alter($form_id, &$form) {
* node to be modified
*/
function _print_pdf_set_node_fields(&$node) {
- $res = db_fetch_object(db_query("SELECT link, comments, url_list FROM {print_pdf_node_conf} WHERE nid = %d", $node->nid));
+ if (isset($node->nid)) {
+ $res = db_fetch_object(db_query("SELECT link, comments, url_list FROM {print_pdf_node_conf} WHERE nid = %d", $node->nid));
+ }
+ else {
+ $res = FALSE;
+ }
$node->print_pdf_display = $res ? intval($res->link) : PRINT_TYPE_SHOW_LINK_DEFAULT;
$node->print_pdf_display_comment = $res ? intval($res->comments) : PRINT_TYPE_COMMENT_LINK_DEFAULT;
$node->print_pdf_display_urllist = $res ? intval($res->url_list) : PRINT_TYPE_URLLIST_DEFAULT;