Overrides Link::render_link
function render_link($data, $values) {
list($node, $vid) = $this
->get_revision_entity($values, 'view');
if (!isset($vid)) {
return;
}
// Current revision uses the node view path.
$path = 'node/' . $node->nid;
if ($node->vid != $vid) {
$path .= "/revisions/{$vid}/view";
}
$this->options['alter']['make_link'] = TRUE;
$this->options['alter']['path'] = $path;
$this->options['alter']['query'] = drupal_get_destination();
return !empty($this->options['text']) ? $this->options['text'] : t('view');
}