Commit 5995bdec authored by jcnventura's avatar jcnventura

Issue #1258536 by logaritmisk: set node-type fields to default when not set.

parent 4a8a0c57
......@@ -460,9 +460,15 @@ function print_node_load($nodes, $types) {
*/
function print_node_insert($node) {
if (user_access('administer print') || user_access('node-specific print configuration')) {
if ($node->print_display === NULL) $node->print_display = variable_get('print_display_' . $node->type, PRINT_TYPE_SHOW_LINK_DEFAULT);
if ($node->print_display_comment === NULL) $node->print_display_comment = variable_get('print_display_comment_' . $node->type, PRINT_TYPE_COMMENT_LINK_DEFAULT);
if ($node->print_display_urllist === NULL) $node->print_display_urllist = variable_get('print_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
if (!isset($node->print_display) || $node->print_display === NULL) {
$node->print_display = variable_get('print_display_' . $node->type, PRINT_TYPE_SHOW_LINK_DEFAULT);
}
if (!isset($node->print_display_comment) || $node->print_display_comment === NULL) {
$node->print_display_comment = variable_get('print_display_comment_' . $node->type, PRINT_TYPE_COMMENT_LINK_DEFAULT);
}
if (!isset($node->print_display_urllist) || $node->print_display_urllist === NULL) {
$node->print_display_urllist = variable_get('print_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
}
_print_node_conf_modify($node->nid, $node->print_display, $node->print_display_comment, $node->print_display_urllist);
}
......
......@@ -220,9 +220,15 @@ function print_mail_node_load($nodes, $types) {
*/
function print_mail_node_insert($node) {
if (user_access('administer print') || user_access('node-specific print configuration')) {
if ($node->print_mail_display === NULL) $node->print_mail_display = variable_get('print_mail_display_' . $node->type, PRINT_TYPE_SHOW_LINK_DEFAULT);
if ($node->print_mail_display_comment === NULL) $node->print_mail_display_comment = variable_get('print_mail_display_comment_' . $node->type, PRINT_TYPE_COMMENT_LINK_DEFAULT);
if ($node->print_mail_display_urllist === NULL) $node->print_mail_display_urllist = variable_get('print_mail_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
if (!isset($node->print_mail_display) || $node->print_mail_display === NULL) {
$node->print_mail_display = variable_get('print_mail_display_' . $node->type, PRINT_TYPE_SHOW_LINK_DEFAULT);
}
if (!isset($node->print_mail_display_comment) || $node->print_mail_display_comment === NULL) {
$node->print_mail_display_comment = variable_get('print_mail_display_comment_' . $node->type, PRINT_TYPE_COMMENT_LINK_DEFAULT);
}
if (!isset($node->print_mail_display_urllist) || $node->print_mail_display_urllist === NULL) {
$node->print_mail_display_urllist = variable_get('print_mail_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
}
_print_mail_node_conf_modify($node->nid, $node->print_mail_display, $node->print_mail_display_comment, $node->print_mail_display_urllist);
}
......
......@@ -335,9 +335,15 @@ function print_pdf_node_load($nodes, $types) {
*/
function print_pdf_node_insert($node) {
if (user_access('administer print') || user_access('node-specific print configuration')) {
if ($node->print_pdf_display === NULL) $node->print_pdf_display = variable_get('print_pdf_display_' . $node->type, PRINT_TYPE_SHOW_LINK_DEFAULT);
if ($node->print_pdf_display_comment === NULL) $node->print_pdf_display_comment = variable_get('print_pdf_display_comment_' . $node->type, PRINT_TYPE_COMMENT_LINK_DEFAULT);
if ($node->print_pdf_display_urllist === NULL) $node->print_pdf_display_urllist = variable_get('print_pdf_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
if (!isset($node->print_pdf_display) || $node->print_pdf_display === NULL) {
$node->print_pdf_display = variable_get('print_pdf_display_' . $node->type, PRINT_TYPE_SHOW_LINK_DEFAULT);
}
if (!isset($node->print_pdf_display_comment) || $node->print_pdf_display_comment === NULL) {
$node->print_pdf_display_comment = variable_get('print_pdf_display_comment_' . $node->type, PRINT_TYPE_COMMENT_LINK_DEFAULT);
}
if (!isset($node->print_pdf_display_urllist) || $node->print_pdf_display_urllist === NULL) {
$node->print_pdf_display_urllist = variable_get('print_pdf_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
}
_print_pdf_node_conf_modify($node->nid, $node->print_pdf_display, $node->print_pdf_display_comment, $node->print_pdf_display_urllist);
}
......
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