path: root/core/modules/node/src/Entity/Node.php
diff options
authorwebchick2015-09-11 18:13:56 (GMT)
committerwebchick2015-09-11 18:13:56 (GMT)
commitdbf74b3724f242039e659ff8713f660ce17a960c (patch)
tree71e4d070570498a98611db94fa36b35cd9ce516e /core/modules/node/src/Entity/Node.php
parentb42b41ac4d04930d42ba31944f46cefc90c34d7d (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/Entity/Node.php')
1 files changed, 2 insertions, 2 deletions
diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php
index 84a657b..1e5e5ef 100644
--- a/core/modules/node/src/Entity/Node.php
+++ b/core/modules/node/src/Entity/Node.php
@@ -91,9 +91,9 @@ class Node extends ContentEntityBase implements NodeInterface {
public function preSave(EntityStorageInterface $storage) {
- // If no owner has been set explicitly, make the current user the owner.
+ // If no owner has been set explicitly, make the anonymous user the owner.
if (!$this->getOwner()) {
- $this->setOwnerId(\Drupal::currentUser()->id());
+ $this->setOwnerId(0);
// If no revision author has been set explicitly, make the node owner the
// revision author.