function print_update_5306 in Printer, email and PDF versions 5.4
Update to version 5.x-4.10
File
- ./
print.install, line 298 - Install file of the print module
Code
function print_update_5306() {
$ret = array();
foreach (node_get_types() as $key => $value) {
$print_display = variable_get('print_display_' . $value->type, 1);
$print_display_comment = variable_get('print_display_comment_' . $value->type, 0);
$print_display_urllist = variable_get('print_display_urllist_' . $value->type, 1);
if (!$print_display || $print_display_comment || !$print_display_urllist) {
$result = db_query("SELECT n.nid, link, comments, url_list from {node} AS n LEFT JOIN {print_node_conf} AS pnc ON n.nid = pnc.nid WHERE type = '%s'", $value->type);
while ($conf = db_fetch_object($result)) {
if ($conf->link != NULL && $conf->comments != NULL && $conf->url_list != NULL) {
$conf->link = !$print_display ? 0 : $conf->link;
$conf->comments = $print_display_comment ? 1 : $conf->comments;
$conf->url_list = !$print_display_urllist ? 0 : $conf->url_list;
$ret[] = update_sql("UPDATE {print_node_conf} SET link = {$conf->link}, comments = {$conf->comments}, url_list = {$conf->url_list} WHERE nid = {$conf->nid}");
}
else {
$ret[] = update_sql("INSERT INTO {print_node_conf} (nid, link, comments, url_list) VALUES ({$conf->nid}, {$print_display}, {$print_display_comment}, {$print_display_urllist})");
}
}
}
}
return $ret;
}