Skip to content
Snippets Groups Projects
Commit 5e395e7e authored by Moshe Weitzman's avatar Moshe Weitzman
Browse files

#175663 Get correct node field titles from node type.

parent 02b76bad
No related branches found
Tags 8.x-1.0-alpha4
No related merge requests found
......@@ -5,19 +5,23 @@
* Implementation of hook_diff() for node.module (body and title).
*/
function node_diff(&$old_node, &$new_node) {
$result = array();
$type = node_get_types('type', $new_node);
$result[] = array(
'name' => t('Title'),
'name' => $type->title_label,
'old' => array($old_node->title),
'new' => array($new_node->title),
'format' => array(
'show_header' => false,
)
);
$result[] = array(
'name' => t('Body'),
'old' => explode("\n", $old_node->body),
'new' => explode("\n", $new_node->body),
);
if ($type->has_body) {
$result[] = array(
'name' => $type->body_label,
'old' => explode("\n", $old_node->body),
'new' => explode("\n", $new_node->body),
);
}
return $result;
}
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