From 900ba263c790969f00994cb7d226cc2735fffd36 Mon Sep 17 00:00:00 2001 From: naomi Date: Sun, 29 Apr 2018 14:50:41 +0200 Subject: [PATCH] Actor name field is now set to full name on save --- modules/opencase_entities/src/Entity/OCActor.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/opencase_entities/src/Entity/OCActor.php b/modules/opencase_entities/src/Entity/OCActor.php index 662b62f..936180c 100644 --- a/modules/opencase_entities/src/Entity/OCActor.php +++ b/modules/opencase_entities/src/Entity/OCActor.php @@ -114,6 +114,12 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface $translation->setOwnerId(0); } } + + $name = $this->get('first_name') ->value . ' '; + if ($this->get('middle_names')->value) $name .= $this->get('middle_names')->value . ' '; + $name .= $this->get('last_name')->value; + + $this->setName($name); // If no revision author has been set explicitly, make the oc_actor owner the // revision author.