Issue #2164715 by Berdir: Remove user_node_load().
parent
27a94ebdc0
commit
b446b4299c
|
@ -1749,29 +1749,6 @@ function user_form_process_password_confirm($element) {
|
||||||
return $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().
|
* Implements hook_modules_installed().
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue