Closed (duplicate)
Project:
Drupal core
Version:
6.10
Component:
postgresql database
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Apr 2009 at 01:20 UTC
Updated:
6 Apr 2009 at 12:28 UTC
When trying to save changes to an existing book page, the error below occurred, after which the node's vid was set to 0, breaking drupal's ability to find the page:
pg_query() [function.pg-query]: Query failed: ERROR: null value in column "log" violates not-null constraint in /srv/www/drupal-6.10/includes/database.pgsql.inc on line 139.
query: INSERT INTO node_revisions (nid, uid, title, body, teaser, timestamp, format) VALUES (6, 3, 'Characters', , 1238977824, 1) in /srv/www/drupal-6.10/includes/common.inc on line 3422.
Comments
Comment #1
pwolanin commentedThe bad query isautomatically generated here: http://api.drupal.org/api/function/drupal_write_record/6
The fact that the log message is NULL is odd - suggests the real bug is here:
http://api.drupal.org/api/function/node_form/6
node fields should NOT be conditionally added to the form, but rather controlled via #access.
Since the bug seems to be the same in 7.x it should be fixed there first.
Comment #2
anderbubble commentedFor what it's worth, I fixed this at my own installation by setting the log column in question to have a default value of (''::character varrying), to match the title column in the same table.
Comment #3
pwolanin commentedduplicate to: http://drupal.org/node/223820
there is a patch there.
Comment #4
pwolanin commentedtext columns cannot have a default value in MySQL strict mode, for example, so see the patch.
Comment #5
josh waihi commentedsubscribing, will look at this when I have more time.
Comment #6
pwolanin commentedthis is a duplicate - please see the linked issues, and the more general issue it links to. http://drupal.org/node/261258