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

#239056 - Fixed path to the latest diff (current and previous versions)

parent 8654600d
No related branches found
Tags 8.x-3.0-alpha4
No related merge requests found
......@@ -52,12 +52,29 @@ function diff_menu($may_cache) {
'weight' => 4,
'type' => MENU_LOCAL_TASK,
);
$items[] = array(
'path' => 'node/'. arg(1) .'/revisions/view/latest',
'title' => t('Revisions'),
'callback' => 'diff_latest',
'callback arguments' => array(arg(1)),
'access' => $revisions_access,
'type' => MENU_CALLBACK,
);
}
}
}
return $items;
}
// Menu callback - show latest revision for a given node.
function diff_latest($nid) {
$nid = (int)$nid;
$revisions = node_revision_list(node_load($nid));
$new = array_shift($revisions);
$old = array_shift($revisions);
drupal_goto("node/$nid/revisions/view/$old->vid/$new->vid");
}
/**
* Adjust the module weights for diff to load after node module.
*/
......
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