This is a followup to #261258: Fix node_save() insertion logic. One of the tests in the final patch that was committed there does not actually test empty log messages in the way that it is supposed to.

To see this, remove the following code from node_save():

    elseif (empty($node->log)) {
      // If we are updating an existing node without adding a new revision, we
      // need to make sure $node->log is unset whenever it is empty. As long as
      // $node->log is unset, drupal_write_record() will not attempt to update
      // the existing database column when re-saving the revision; therefore,
      // this code allows us to avoid clobbering an existing log entry with an
      // empty one.
      unset($node->log);
    }

The node module tests will still pass, but they shouldn't. With the attached patch, the test will correctly fail in that case.

CommentFileSizeAuthor
#1 node-log-test-700862-1.patch1.23 KBDavid_Rothstein
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

David_Rothstein’s picture

And the patch...

catch’s picture

Status: Needs review » Reviewed & tested by the community

Very straightforward, rtbc.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Oops. :) That's not good. Committed to HEAD.

gost_gost’s picture

Status: Fixed » Needs review

#1: node-log-test-700862-1.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, node-log-test-700862-1.patch, failed testing.

Damien Tournoud’s picture

Status: Needs work » Closed (fixed)