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();
Project Usage
937
Creation Date
Changed Date
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

OPENAI CHATBOT

OPENAI CHATBOT

16:29:54
Generic Chatbot
Hi, I'm a Drupal module expert powered by OpenAI, answering your questions about the Drupal module ecosystem. How can I be helpful today? Please note that we will log your question.