Module Description
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();
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();
Module Link
Project Usage
937
Security Covered
Covered By Security Advisory
Version Available
Production
Module Summary
This module aims to prevent fields of type changed from being updated when the host entity is updating, solving a common issue in Drupal core.
Data Name
preserve_changed