Attempt to prevent article term fixes from changing the updated time of all our articles

This commit is contained in:
Benjamin Melançon 2019-08-31 10:05:07 -04:00
parent 6c1787c9c2
commit f27a41a12a

View file

@ -95,6 +95,8 @@ function apply_term($term_id, $entity_ids) {
if ($add_term == TRUE) {
$entity_terms = array_merge($entity->get('field_article_type')->getValue(), [['target_id' => $term_id]]);
$entity->set('field_article_type', $entity_terms);
// Prevent this cleanup from changing the updated time of all our articles.
$entity->setChangedTime($entity->getChangedTime());
$entity->save();
}