Commit eb0da10e authored by catch's avatar catch

Issue #2902896 by quocnht, joachim: Replace REQUEST_TIME with time service in ChangedItem

parent a0bb5da1
......@@ -30,7 +30,7 @@ public function preSave() {
// Set the timestamp to request time if it is not set.
if (!$this->value) {
$this->value = REQUEST_TIME;
$this->value = \Drupal::time()->getRequestTime();
}
else {
// On an existing entity translation, the changed timestamp will only be
......@@ -47,7 +47,7 @@ public function preSave() {
if (!$entity->isNew() && $original->hasTranslation($langcode)) {
$original_value = $original->getTranslation($langcode)->get($this->getFieldDefinition()->getName())->value;
if ($this->value == $original_value && $entity->hasTranslationChanges()) {
$this->value = REQUEST_TIME;
$this->value = \Drupal::time()->getRequestTime();
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment