- Issue created by @tostinni
When updating various nodes, all of them will have their updated date changed to the current date which may confuse administrators to see that all content where just updated and sometimes could end up being visible on front if this field is displayed.
Batch update several content and see the "Updated" column in /admin/content
.
Add an option in the "Select fields to change" form to left the date untouched.
As a reference we have :
Patch to be written.
I don't have time right now to work on this feature, but here is a small code to help dealing with this problem.
/**
* Implements hook_entity_presave().
* Prevent changed date from bein update when running batches / using VBO.
*/
function MODULE_entity_presave(EntityInterface $entity) {
if (\Drupal::routeMatch()->getRouteName() == 'system.batch_page.json' && isset($entity->original->changed)) {
$entity->changed = $entity->original->changed;
}
}
Active
2.0
Code