Skip to content
Snippets Groups Projects
Commit b446b429 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2164715 by Berdir: Remove user_node_load().

parent 27a94ebd
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -1749,29 +1749,6 @@ function user_form_process_password_confirm($element) {
return $element;
}
/**
* Implements hook_node_load().
*
* @todo Deprecated by $node->author, attached in
* \Drupal\node\NodeViewBuilder::buildContent(). Update code that
* depends on these properties.
*/
function user_node_load($nodes) {
// Build an array of all uids for node authors, keyed by nid.
$uids = array();
foreach ($nodes as $nid => $node) {
$uids[$nid] = $node->getAuthorId();
}
// Fetch name and data for these users.
$user_names = db_query("SELECT uid, name FROM {users} WHERE uid IN (:uids)", array(':uids' => $uids))->fetchAllKeyed();
// Add these values back into the node objects.
foreach ($uids as $nid => $uid) {
$nodes[$nid]->name = $user_names[$uid];
}
}
/**
* Implements hook_modules_installed().
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment