From d94ea6fb0acc910fd6cc7b95331f2938ed081489 Mon Sep 17 00:00:00 2001
From: Earl Miles <merlin@logrus.com>
Date: Thu, 1 Jan 2009 18:24:58 +0000
Subject: [PATCH] Make sure base url is properly removed from task handler
 operations links which are not really links.

---
 delegator/js/task-handlers.js         | 2 +-
 delegator/plugins/tasks/node_view.inc | 1 +
 delegator/plugins/tasks/user_view.inc | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/delegator/js/task-handlers.js b/delegator/js/task-handlers.js
index 7a4da574..b663ed2f 100644
--- a/delegator/js/task-handlers.js
+++ b/delegator/js/task-handlers.js
@@ -28,7 +28,7 @@ Drupal.behaviors.zzGoLastDelegatorTaskList = function(context) {
     $dropdown = $(this).parent().siblings('.ctools-dropdown');
    
     $('.ctools-dropdown-container a', $dropdown).click(function() {
-      var val = $(this).attr('href').replace('/', '');
+      var val = $(this).attr('href')..replace(/^.*[\/\\]/g, '');
 
       // ignore empty
       if (!val) {
diff --git a/delegator/plugins/tasks/node_view.inc b/delegator/plugins/tasks/node_view.inc
index a1008c18..827a2cc7 100644
--- a/delegator/plugins/tasks/node_view.inc
+++ b/delegator/plugins/tasks/node_view.inc
@@ -58,6 +58,7 @@ function delegator_node_view($node) {
   $task = delegator_get_task('node_view');
 
   // Load the node into a context.
+  ctools_include('context');
   ctools_include('context-task-handler');
   $contexts = ctools_context_handler_get_task_contexts($task, '', array($node));
 
diff --git a/delegator/plugins/tasks/user_view.inc b/delegator/plugins/tasks/user_view.inc
index e96ff1ed..384ea055 100644
--- a/delegator/plugins/tasks/user_view.inc
+++ b/delegator/plugins/tasks/user_view.inc
@@ -57,6 +57,7 @@ function delegator_user_view($account) {
   $task = delegator_get_task('user_view');
 
   // Load the account into a context.
+  ctools_include('context');
   ctools_include('context-task-handler');
   $contexts = ctools_context_handler_get_task_contexts($task, '', array($account));
 
-- 
GitLab