Create a new content type: leave the Body label empty, so the node will not have a body, and in Workflow Settings, choose Create New Revision.

Now, create a new node of this type, and save it. This works fine.

Then, edit the node and save it. Instead of going back to the node page, you will get a Page Not Found error, with the following Drupal error message:

user warning: Field 'body' doesn't have a default value query: INSERT INTO node_revisions (nid, uid, title, teaser, log, timestamp, format) VALUES (4, 1, 'fgdghdhdhgd', '', '', 1225857929, 0)

My guess is that in node_save(), we should replace:

  elseif (!empty($node->revision)) {
    $node->old_vid = $node->vid;
  }

by

  elseif (!empty($node->revision)) {
    $node->old_vid = $node->vid;

    if (!isset($node->teaser)) {
      $node->teaser = '';
    }
    if (!isset($node->body)) {
      $node->body = '';
    }
  }
CommentFileSizeAuthor
#1 node.module.330290.patch724 bytesDavid Lesieur

Comments

David Lesieur’s picture

Version: 6.6 » 6.x-dev
Status: Active » Needs review
StatusFileSize
new724 bytes

Here's a patch for this.

damien tournoud’s picture

Status: Needs review » Closed (duplicate)

My guess is that this is a duplicate of #261258: Fix node_save() insertion logic.