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.
I am using rules to set a data value of a field on a node. Works great!
BUT, when the rule is triggered, the node's 'updated' timestamp is changed. In my particular application, I do NOT want this to happen. I totally understand why this behavior might be desired by some (most), but in my case I don't.
Is there any way to prevent the 'updated' timestamp from being updated when rules is used to set/change the value of a field on that node?
Comments
Comment #2
arlinsandbulte CreditAttribution: arlinsandbulte as a volunteer commentedComment #3
arlinsandbulte CreditAttribution: arlinsandbulte as a volunteer commentedComment #4
TR CreditAttribution: TR commentedI assume you mean the 'changed' timestamp ...
Of course the 'changed' timestamp is modified to reflect the time that you made changes to the node. That's core Drupal functionality, and you don't have a way to override that because that's fundamental to the way Drupal works. I can't imagine why you would want to modify the node and not be able to track when or if it was modified last, but I suppose you could hack core to prevent that from happening. You could probably also write some custom code to set the timestamp back to what it was before your change, but it seems to me you would have to do a lot of work to make that happen. Maybe it's better to re-think your requirement and your data model - for example your field could be an entity reference, then changing a value on the entity that the reference points to wouldn't change the node that holds the reference field, hence would leave the node's 'changed' timestamp alone.