diff -u b/modules/entity_share_client/src/Plugin/EntityShareClient/Processor/EntityReference.php b/modules/entity_share_client/src/Plugin/EntityShareClient/Processor/EntityReference.php --- b/modules/entity_share_client/src/Plugin/EntityShareClient/Processor/EntityReference.php +++ b/modules/entity_share_client/src/Plugin/EntityShareClient/Processor/EntityReference.php @@ -186,16 +186,14 @@ if ($processed_entity->hasField($field_public_name)) { - $processed_entity->set($field_public_name, $field_values); + $field_name = $field_public_name; } else if ($processed_entity->hasField($field_internal_name)) { // Just to be sure that one of the field names is used and // the field exists. - $processed_entity->set($field_internal_name, $field_values); + $field_name = $field_internal_name; } + if (!empty($field_values) || (empty($field_values) && !$processed_entity->getFieldDefinition($field_public_name)->isRequired())) { + $processed_entity->set($field_name, $field_values); + } } - // Ensure that the creator is the current user. - if ($processed_entity->hasField('uid')) { - $processed_entity->set('uid', $this->currentUser->id()); - } - // @todo Test if this is still needed.