I've created a custom node type with CCK and made the CCK node type not showing me the body field. I have created the node and saved. Now I've edited one text fields inside this node and checked the "create new revision" checkbox.

After pressing save I've got a WSOD and the node is now no longer accessible in view/edit. When I opened another page I saw this errors:

    * user warning: Field 'body' doesn't have a default value query: INSERT INTO node_revisions (nid, uid, title, teaser, log, timestamp, format) VALUES (2, 1, 'The Golden Cage DE overlong title that needs truncated in teaser view', '', '', 1255017351, 0) in \includes\common.inc on line 3468.
    * warning: Invalid argument supplied for foreach() in \sites\all\modules\cck\content.module on line 1284.

Looking into content_type_mynodetype I can see a new row has been created, having a VID = 0 and NID as the previous version. node_revisions do not have a new row.

It's pretty save that something is now cluttered in the DB and I have no idea why... creating a new revision of a CCK node type should be supported... PLEASE HELP.

Comments

markus_petrux’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Well, it usually works. Switching issue category to "Support request".

There might be something wrong in your installation that caused this problem.

The first error happens in common.inc, so it might be interesting to print a debug_backtrace to see what happened, if it can be reproduced. Maybe that helps to see who could have changed the data passed to drupal_write_record() to write a node_revision record, which is usually the node module, not CCK, and here there might be a lot of other modules messing things around.

You could also try on a clean installation, just with Drupal and CCK with (say) a text field on a custom node type with body disabled. This should work.

hass’s picture

Category: support » bug

This is on a brand new D6.14 with CCK 2.5 and only ~2-3 contrib modules (e.g. link) enabled. Have you tested it? I will try to repro on another machine and debug on the one that failed, but I found many reports about this issue on d.o.

This is a bug - if not CCK than somewhere else, but I do not have many modules installed on this site yet. It's a very basic standard Drupal install with CCK and nothing else.

markus_petrux’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

@hass: Yes, I tested, but I have never seen this error. It might depend on something related to MySQL. I don't know. Anyway, there's an issue in the Drupal queue about this: #261258: Fix node_save() insertion logic

hass’s picture

THX for the link... more than one year unfixed... bad news.

gost_gost’s picture

Getting this error consistently with 6.15 , I get disappearing nodes.

zilched’s picture

I also get this issue with 6.15. I have set the body not to appear and on node save, I receive the following message

•user warning: Field 'body' doesn't have a default value query: drupal_write_record /* michael : drupal_write_record */ INSERT INTO projectpulse_node_revisions (nid, uid, title, teaser, log, timestamp, format) VALUES (172, 14, 'move to kenya', '', 'blah blah blah', 1266670357, 0) in C:\Development\www\drupal_6\trunk\includes\common.inc on line 3467.
•user warning: Column 'vid' cannot be null query: content_write_record /* michael : content_write_record */ UPDATE projectpulse_content_type_project SET vid = NULL, nid = 172, field_project_manager_uid = 14, field_project_completed_value = 0, field_project_completed_date_value = NULL, field_project_code_value = NULL, field_project_description_value = NULL, field_parent_company_nid = NULL, field_project_status_value = 0, field_project_start_date_value = '2010-02-01T00:00:00' WHERE vid = 0 in C:\Development\www\drupal_6\trunk\sites\all\modules\cck\content.module on line 1213.

The node disappears but setting node.vid back to the node id will make it reappear. Is there somewhere I should set default value for the body field

vertikal.dk’s picture

Folks,

I had this error, but upgraded from 6.13 to 6.16 and ran update.php (with lots of database errors), and came out in the end with a smoothly running site and the error gone!

BTW: I only got the error when using "create new version" on custom node types with lots of CCK fields - for whatever that's worth.

Martin

hass’s picture

This issue is fixed in current Core DEV and will be fixed in 6.17.