Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | node-log-test-700862-1.patch | 1.23 KB | David_Rothstein |
Comments
Comment #1
David_Rothstein CreditAttribution: David_Rothstein commentedAnd the patch...
Comment #2
catchVery straightforward, rtbc.
Comment #3
webchickOops. :) That's not good. Committed to HEAD.
Comment #4
gost_gost CreditAttribution: gost_gost commented#1: node-log-test-700862-1.patch queued for re-testing.
Comment #6
Damien Tournoud CreditAttribution: Damien Tournoud commented