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
Comment #1
markus_petrux commentedWell, 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.
Comment #2
hass commentedThis 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.
Comment #3
markus_petrux commented@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
Comment #4
hass commentedTHX for the link... more than one year unfixed... bad news.
Comment #5
gost_gost commentedGetting this error consistently with 6.15 , I get disappearing nodes.
Comment #6
zilched commentedI also get this issue with 6.15. I have set the body not to appear and on node save, I receive the following message
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
Comment #7
vertikal.dk commentedFolks,
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
Comment #8
hass commentedThis issue is fixed in current Core DEV and will be fixed in 6.17.