From c262a1e30fccfabfd5785725de19caee062cf615 Mon Sep 17 00:00:00 2001 From: owenbush <ojb@ukhhf.co.uk> Date: Mon, 30 Mar 2020 10:50:29 -0600 Subject: [PATCH] Remove use of REQUEST_TIME in revisioning functionality --- src/Form/EventInstanceForm.php | 2 +- src/Form/EventInstanceRevisionRevertForm.php | 2 +- src/Form/EventInstanceRevisionRevertTranslationForm.php | 2 +- src/Form/EventSeriesForm.php | 2 +- src/Form/EventSeriesRevisionRevertForm.php | 2 +- src/Form/EventSeriesRevisionRevertTranslationForm.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Form/EventInstanceForm.php b/src/Form/EventInstanceForm.php index 4be8c39f..ce3a1b77 100644 --- a/src/Form/EventInstanceForm.php +++ b/src/Form/EventInstanceForm.php @@ -96,7 +96,7 @@ class EventInstanceForm extends ContentEntityForm { $entity->setNewRevision(); // If a new revision is created, save the current user as revision author. - $entity->setRevisionCreationTime(REQUEST_TIME); + $entity->setRevisionCreationTime(\Drupal::time()->getRequestTime()); $entity->setRevisionUserId(\Drupal::currentUser()->id()); } else { diff --git a/src/Form/EventInstanceRevisionRevertForm.php b/src/Form/EventInstanceRevisionRevertForm.php index 1122e360..87ee9b85 100644 --- a/src/Form/EventInstanceRevisionRevertForm.php +++ b/src/Form/EventInstanceRevisionRevertForm.php @@ -155,7 +155,7 @@ class EventInstanceRevisionRevertForm extends ConfirmFormBase { protected function prepareRevertedRevision(EventInterface $revision, FormStateInterface $form_state) { $revision->setNewRevision(); $revision->isDefaultRevision(TRUE); - $revision->setRevisionCreationTime(REQUEST_TIME); + $revision->setRevisionCreationTime(\Drupal::time()->getRequestTime()); return $revision; } diff --git a/src/Form/EventInstanceRevisionRevertTranslationForm.php b/src/Form/EventInstanceRevisionRevertTranslationForm.php index 1bb8be93..c349d2c3 100644 --- a/src/Form/EventInstanceRevisionRevertTranslationForm.php +++ b/src/Form/EventInstanceRevisionRevertTranslationForm.php @@ -106,7 +106,7 @@ class EventInstanceRevisionRevertTranslationForm extends EventInstanceRevisionRe $latest_revision_translation->setNewRevision(); $latest_revision_translation->isDefaultRevision(TRUE); - $revision->setRevisionCreationTime(REQUEST_TIME); + $revision->setRevisionCreationTime(\Drupal::time()->getRequestTime()); return $latest_revision_translation; } diff --git a/src/Form/EventSeriesForm.php b/src/Form/EventSeriesForm.php index 5428247e..cce0bd77 100644 --- a/src/Form/EventSeriesForm.php +++ b/src/Form/EventSeriesForm.php @@ -289,7 +289,7 @@ class EventSeriesForm extends ContentEntityForm { $entity->setNewRevision(); // If a new revision is created, save the current user as revision author. - $entity->setRevisionCreationTime(REQUEST_TIME); + $entity->setRevisionCreationTime(\Drupal::time()->getRequestTime()); $entity->setRevisionUserId(\Drupal::currentUser()->id()); } else { diff --git a/src/Form/EventSeriesRevisionRevertForm.php b/src/Form/EventSeriesRevisionRevertForm.php index e09bb4f4..d216ee14 100644 --- a/src/Form/EventSeriesRevisionRevertForm.php +++ b/src/Form/EventSeriesRevisionRevertForm.php @@ -155,7 +155,7 @@ class EventSeriesRevisionRevertForm extends ConfirmFormBase { protected function prepareRevertedRevision(EventInterface $revision, FormStateInterface $form_state) { $revision->setNewRevision(); $revision->isDefaultRevision(TRUE); - $revision->setRevisionCreationTime(REQUEST_TIME); + $revision->setRevisionCreationTime(\Drupal::time()->getRequestTime()); return $revision; } diff --git a/src/Form/EventSeriesRevisionRevertTranslationForm.php b/src/Form/EventSeriesRevisionRevertTranslationForm.php index 17a15ac2..9406fabd 100644 --- a/src/Form/EventSeriesRevisionRevertTranslationForm.php +++ b/src/Form/EventSeriesRevisionRevertTranslationForm.php @@ -106,7 +106,7 @@ class EventSeriesRevisionRevertTranslationForm extends EventSeriesRevisionRevert $latest_revision_translation->setNewRevision(); $latest_revision_translation->isDefaultRevision(TRUE); - $revision->setRevisionCreationTime(REQUEST_TIME); + $revision->setRevisionCreationTime(\Drupal::time()->getRequestTime()); return $latest_revision_translation; } -- GitLab