Index: token.rules.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/Attic/token.rules.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 token.rules.inc
--- token.rules.inc	31 May 2009 15:56:09 -0000	1.1.2.3
+++ token.rules.inc	10 Jul 2009 13:15:42 -0000
@@ -62,7 +62,7 @@
     }
 
     foreach ($used_vars as $name) {
-      $type = $state['variables'][$name]->info['type'];
+      $type = _token_rules_map_type($state['variables'][$name]->info['type']);
 
       $token_id = _token_get_id($type, $vars[$name]);
       if (isset($token_cache[$token_id]) && $token_cache[$token_id] != $name) {
@@ -94,8 +94,19 @@
       '#collapsed' => TRUE,
     );
     $form[$name]['content'] = array(
-      '#value' => theme('token_help', $info['type'], '['. $name .':', ']'),
+      '#value' => theme('token_help', _token_rules_map_type($info['type']), '['. $name . ':', ']'),
     );
   }
   return $form;
 }
+
+/**
+ * Map rules types to corresponding token types
+ */
+function _token_rules_map_type($type) {
+  if (($data_type = rules_get_data_types($type)) && isset($data_type['token type'])) {
+    return $data_type['token type'];
+  }
+  return $type;
+}
+
