From f03b1f7d68f706f5e36f2ee513853f2069de4a38 Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Thu, 20 Jun 2013 15:44:19 -0500
Subject: [PATCH] [#2024595] by dww: Fixed the 'Link to tab' views field for Views 3.

---
 .../views/nodequeue_handler_field_queue_tab.inc    |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/includes/views/nodequeue_handler_field_queue_tab.inc b/includes/views/nodequeue_handler_field_queue_tab.inc
index 25441e9..1388133 100644
--- a/includes/views/nodequeue_handler_field_queue_tab.inc
+++ b/includes/views/nodequeue_handler_field_queue_tab.inc
@@ -5,9 +5,20 @@
  * Views field handler for the nodequeue queue links
  */
 class nodequeue_handler_field_queue_tab extends views_handler_field_node_link {
-  function render($values) {
-    $text = !empty($this->options['text']) ? $this->options['text'] : t('view');
-    $nid = $values->{$this->aliases['nid']};
-    return l($text, "node/$nid/nodequeue");
+  /**
+   * Renders the link.
+   */
+  function render_link($node, $values) {
+    // Ensure user has access to manipulate nodequeues for this node.
+    if (!nodequeue_node_tab_access($node)) {
+      return;
+    }
+
+    $this->options['alter']['make_link'] = TRUE;
+    $this->options['alter']['path'] = "node/$node->nid/nodequeue";
+    $this->options['alter']['query'] = drupal_get_destination();
+
+    $text = !empty($this->options['text']) ? $this->options['text'] : t('nodequeue');
+    return $text;
   }
 }
-- 
1.7.3.5

