- Set up a content type that doesn't use 'body' field
- create a node of this content type
- edit the node, check 'create a new revision' checkbox, save :
PDOException: INSERT INTO {node_revision} (nid, uid, title, teaser, log, timestamp, format) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6) - Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => article1 [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => 1230853018 [:db_insert_placeholder_6] => 0 ) SQLSTATE[HY000]:
General error: 1364 Field 'body' doesn't have a default value in drupal_write_record() (line 3798 \includes\common.inc).
Attached patch makes the body and teaser columns nullable in node_revision table (as suggested in a comment in node_save).
| Comment | File | Size | Author |
|---|---|---|---|
| node.no_body.patch | 2.14 KB | yched |
Comments
Comment #1
damien tournoud commentedThis is a duplicate of #261258: Fix node_save() insertion logic.
Comment #2
yched commentedHm, forgot about that one.
I'd argue that the body and teaser columns *should* be nullable, though. You can set a content type to not have a 'body' field, we should store NULL for those fields, not an empty string.
Comment #3
damien tournoud commentedThey should be. Let's focus this issue on this, postponed until #261258: Fix node_save() insertion logic is in.
Comment #4
yched commentedRight, makes sense.
Comment #5
jody lynnWell the reason for postpone is passed, but not sure if this is still an issue.
Comment #6
swentel commentedYeah, those columns don't even exist anymore.