Obsolete
This module is Obsolete as of Drupal 11 due to #2329253: Allow ChangedItem to skip updating the entity's "changed" timestamp when synchronizing
Description
There's no easy way to prevent the fields of type changed to be updated when the host entity is updating. There are business cases when you don't want this field to be refreshed on an entity save. A Drupal core issue is already dealing with this problem but it's not yet committed. This module covers this lack of API and will be dropped as soon the core issue is fixed.
How to use it?
When saving an existing entity that has a changed field type, mark the field
to be preserved during the save:
$node = Node::load(123);
// Change the title.
$node->title->value = 'New title';
// Mark the 'changed' field to be preserved.
$node->changed->preserve = TRUE;
$node->save();
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.No further development
No longer developed by its maintainers.- Project categories: Site structure
857 sites report using this module
- Created by claudiu.cristea on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.
Releases
Drupal 10 compatibility
Development version: 2.x-dev updated 4 Oct 2022 at 14:01 UTC

