Why does the timestamp of node_revisions and changed of node tables are updated when I save a node without making any changes?

All I want to know if anything ever changed in a node (revision). Is there a way to find it?


If you save a node then it has changed according to Drupal...regardless of whether or not any specific property/CCK field values have actually been changed.

You can find the evidence for this in the node_save() function which contains this line of code which runs for every single call to the function:

// The changed timestamp is always updated for bookkeeping purposes (revisions, searching, ...)
$node->changed = $time;

Drupal does not do any sort of diff against the current and new revisions of a node when saving, so if you've pressed "Save" it makes the assumption that you wanted to add a new revision of the node.

  • I want to use Revisions module to direct a new node change to a moderator. Unfortunately there does not seem to be any way to forward only those nodes whose data have changed – AgA Feb 16 '12 at 14:05

Maybe the Diff module could be helpful for you. It shows the changes between revisions.

This module adds a tab for sufficiently permissioned users. The tab shows all revisions like standard Drupal but it also allows pretty viewing of all added/changed/deleted words between revisions.

  • What does it show if node is saved as a new revision without any changes? – AgA Feb 16 '12 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.