Hello,
I'm using an administrative view to re-order nodes.
Whenever I change the order of nodes, the nodes that have a new weight value are saved and get a new "changed" value.
I'm not sure this behavior can be changed since AFAIK, one can't just udpate a field value in D8, you need to save the whole entity.
However it may be worth to investigate something such as:
$original_changed_timestamp = $node->getChangedTime();
$node->setChangedTime($original_changed_timestamp);
Otherwise, if you put the first item at the bottom of the list, all nodes get updated and will have the current date as "changed" date.
Comments
Comment #2
ludo.rComment #3
ziomizar commentedHi Dolu,
In drupal 8 field_attach_update is deprecated so when we save a field we need to save the whole entity.
There are currently no plans to port some alternatives to D8.
The complexity of the code with this change will increase, and in the current state of this project would be good keep it as simple as possible.
Maybe you can workaround this with some custom code or with a different logic in your application?
Comment #4
ludo.rHi,
Thank you for your feedback, indeed I abandoned this idea, because it seems there is no easy way to do this, my tests with
$node->setChangedTime($original_changed_timestamp);didn't succeed.