Skip to content

Commit

Permalink
Remove double-expansion when $node->author is translated to $node->uid
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisolof committed Mar 7, 2024
1 parent 2580ff8 commit b31df4b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Drupal/Driver/Cores/Drupal8.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,7 @@ public function nodeCreate($node) {
}
// If 'author' is set, remap it to 'uid'.
if (isset($node->author)) {
$user = user_load_by_name($node->author);
/** @var \Drupal\user\Entity\User $user */
if ($user) {
$node->uid = $user->id();
}
$node->uid = $node->author;
}

return $this->entityCreate('node', $node);
Expand Down

0 comments on commit b31df4b

Please sign in to comment.