diff options
author | webchick | 2015-09-11 18:13:56 (GMT) |
---|---|---|
committer | webchick | 2015-09-11 18:13:56 (GMT) |
commit | dbf74b3724f242039e659ff8713f660ce17a960c (patch) | |
tree | 71e4d070570498a98611db94fa36b35cd9ce516e /core/modules/node/src/NodeForm.php | |
parent | b42b41ac4d04930d42ba31944f46cefc90c34d7d (diff) |
Issue #2566419 by amateescu, dawehner, jhedstrom, hchonov, hussainweb, jibran: Using the "Autocomplete (Tags style)" widget for the author field does not save the submitted user
Diffstat (limited to 'core/modules/node/src/NodeForm.php')
-rw-r--r-- | core/modules/node/src/NodeForm.php | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php index ec0ad41..36cfc74 100644 --- a/core/modules/node/src/NodeForm.php +++ b/core/modules/node/src/NodeForm.php @@ -356,24 +356,6 @@ class NodeForm extends ContentEntityForm { /** * {@inheritdoc} */ - public function buildEntity(array $form, FormStateInterface $form_state) { - /** @var \Drupal\node\NodeInterface $entity */ - $entity = parent::buildEntity($form, $form_state); - // A user might assign the node author by entering a user name in the node - // form, which we then need to translate to a user ID. - // @todo: Remove it when https://www.drupal.org/node/2322525 is pushed. - if (!empty($form_state->getValue('uid')[0]['target_id']) && $account = User::load($form_state->getValue('uid')[0]['target_id'])) { - $entity->setOwnerId($account->id()); - } - else { - $entity->setOwnerId(0); - } - return $entity; - } - - /** - * {@inheritdoc} - */ public function save(array $form, FormStateInterface $form_state) { $node = $this->entity; $insert = $node->isNew(); |