? ctools-[issue-number].patch Index: plugins/contexts/node.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/ctools/plugins/contexts/node.inc,v retrieving revision 1.11.2.5 diff -u -p -r1.11.2.5 node.inc --- plugins/contexts/node.inc 20 May 2010 01:43:03 -0000 1.11.2.5 +++ plugins/contexts/node.inc 25 Jan 2011 04:23:04 -0000 @@ -170,8 +170,11 @@ function ctools_context_node_convert_lis 'type' => t('Node type'), ); + // Include tokens provided by token.module. if (module_exists('token')) { - $list += reset(token_get_list(array('node'))); + foreach (token_get_list(array('node')) as $tokens) { + $list += $tokens; + } } return $list; @@ -193,9 +196,12 @@ function ctools_context_node_convert($co case 'type': return $context->data->type; } + + // Check if token.module can provide the replacement. if (module_exists('token')) { $values = token_get_values('node', $context->data); - if ($key = array_search($type, $values->tokens)) { + $key = array_search($type, $values->tokens); + if ($key !== FALSE) { return $values->values[$key]; } } Index: plugins/contexts/token.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/ctools/plugins/contexts/token.inc,v retrieving revision 1.1.2.2 diff -u -p -r1.1.2.2 token.inc --- plugins/contexts/token.inc 23 Feb 2010 21:00:59 -0000 1.1.2.2 +++ plugins/contexts/token.inc 25 Jan 2011 04:23:04 -0000 @@ -32,16 +32,19 @@ function ctools_context_create_token($em * Implementation of hook_ctools_context_convert_list(). */ function ctools_context_token_convert_list() { - // Pass everything through to token_get_list(). - return reset(token_get_list(array('global'))); + $list = array(); + foreach (token_get_list(array('global')) as $tokens) { + $list += $tokens; + } + return $list; } /** * Implementation of hook_ctools_context_converter_alter(). */ -function ctools_context_token_convert($context, $token) { - $values = token_get_values(); - $key = array_search($token, $values->tokens); +function ctools_context_token_convert($context, $type) { + $values = token_get_values('global'); + $key = array_search($type, $values->tokens); if ($key !== FALSE) { return $values->values[$key]; } Index: plugins/contexts/user.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/ctools/plugins/contexts/user.inc,v retrieving revision 1.4.2.6 diff -u -p -r1.4.2.6 user.inc --- plugins/contexts/user.inc 3 Aug 2010 18:45:21 -0000 1.4.2.6 +++ plugins/contexts/user.inc 25 Jan 2011 04:23:04 -0000 @@ -149,9 +149,14 @@ function ctools_context_user_convert_lis 'uid' => t('User ID'), 'name' => t('User name'), ); + + // Include tokens provided by token.module. if (module_exists('token')) { - $list += reset(token_get_list(array('user'))); + foreach (token_get_list(array('user')) as $tokens) { + $list += $tokens; + } } + return $list; } @@ -165,9 +170,12 @@ function ctools_context_user_convert($co case 'name': return $context->data->name; } + + // Check if token.module can provide the replacement. if (module_exists('token')) { $values = token_get_values('user', $context->data); - if ($key = array_search($type, $values->tokens)) { + $key = array_search($type, $values->tokens); + if ($key !== FALSE) { return $values->values[$key]; } }