From 1624ba5ebba761e0c4a6a41053ee6eeb74335347 Mon Sep 17 00:00:00 2001 From: orakili Date: Wed, 4 Sep 2024 15:16:01 +0000 Subject: [PATCH] fix: ensure the revision user and timestamp is correctly set when editing a term profile or user posting rights Refs: RW-1071 --- .../custom/reliefweb_fields/src/Form/TaxonomyTermProfile.php | 2 ++ .../reliefweb_fields/src/Form/TaxonomyTermUserPostingRights.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/html/modules/custom/reliefweb_fields/src/Form/TaxonomyTermProfile.php b/html/modules/custom/reliefweb_fields/src/Form/TaxonomyTermProfile.php index 6396a4d9e..60519c5db 100644 --- a/html/modules/custom/reliefweb_fields/src/Form/TaxonomyTermProfile.php +++ b/html/modules/custom/reliefweb_fields/src/Form/TaxonomyTermProfile.php @@ -42,6 +42,8 @@ public function actions(array $form, FormStateInterface $form_state) { * {@inheritdoc} */ public function save(array $form, FormStateInterface $form_state) { + $this->entity->setRevisionUserId($this->currentUser()->id()); + $this->entity->setRevisionCreationTime(time()); $this->entity->setRevisionLogMessage(strtr('!bundle profile update', [ '!bundle' => $this->getBundleLabel(), ])); diff --git a/html/modules/custom/reliefweb_fields/src/Form/TaxonomyTermUserPostingRights.php b/html/modules/custom/reliefweb_fields/src/Form/TaxonomyTermUserPostingRights.php index d84f68d8a..ddf19833c 100644 --- a/html/modules/custom/reliefweb_fields/src/Form/TaxonomyTermUserPostingRights.php +++ b/html/modules/custom/reliefweb_fields/src/Form/TaxonomyTermUserPostingRights.php @@ -42,6 +42,8 @@ public function actions(array $form, FormStateInterface $form_state) { * {@inheritdoc} */ public function save(array $form, FormStateInterface $form_state) { + $this->entity->setRevisionUserId($this->currentUser()->id()); + $this->entity->setRevisionCreationTime(time()); $this->entity->setRevisionLogMessage('User posting rights update'); return parent::save($form, $form_state); }