From 96668d576cce83ee8082e186149c4504c75c3a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Tue, 11 Dec 2007 14:31:12 +0000 Subject: #195169 (actually a fix to #199161) by bjaspan: do not rely on buggy MySQL behavior of assuming empty default value for NOT NULL columns, fixing poll submission on PostgreSQL --- modules/node/node.module | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'modules') diff --git a/modules/node/node.module b/modules/node/node.module index 601260227..5f945bdb3 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -830,6 +830,16 @@ function node_save(&$node) { if (!isset($node->log)) { $node->log = ''; } + + // For the same reasons, make sure we have $node->teaser and + // $node->body. We should consider making these fields nullable + // in a future version since node types are not required to use them. + if (!isset($node->teaser)) { + $node->teaser = ''; + } + if (!isset($node->body)) { + $node->body = ''; + } } elseif (!empty($node->revision)) { $node->old_vid = $node->vid; -- cgit v1.2.3