Index: modules/themekey.user.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/themekey/modules/themekey.user.inc,v
retrieving revision 1.2
diff -u -r1.2 themekey.user.inc
--- modules/themekey.user.inc	22 Sep 2009 16:45:44 -0000	1.2
+++ modules/themekey.user.inc	25 Sep 2009 12:15:29 -0000
@@ -5,33 +5,29 @@
   // Attributes for properties
   $attributes = array();
   $attributes['user:hostname'] = array(
-    'path' => 'user:hostname',
     'description' => t('User: Hostname')
   );
   $attributes['user:language'] = array(
-    'path' => 'user:language',
     'description' => t('User: Language')
   );
   $attributes['user:name'] = array(
-    'path' => 'user:name',
     'description' => t('User: Name')
   );
   $attributes['user:uid'] = array(
-    'path' => 'user:uid',
     'description' => t('User: ID')
   );
-  
+
   return array('attributes' => $attributes);
 }
 
 function themekey_user_themekey_global() {
   global $user;
-  
+
   $parameters = array();
   $parameters['user:hostname'] = isset($user->hostname) ? $user->hostname : '';
   $parameters['user:language'] = isset($user->language) ? $user->language : 'en';
   $parameters['user:name'] = isset($user->name) ? $user->name : '';
   $parameters['user:uid'] = $user->uid;
-  
+
   return $parameters;
 }
Index: modules/themekey.system.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/themekey/modules/themekey.system.inc,v
retrieving revision 1.2
diff -u -r1.2 themekey.system.inc
--- modules/themekey.system.inc	22 Sep 2009 16:45:44 -0000	1.2
+++ modules/themekey.system.inc	25 Sep 2009 12:15:29 -0000
@@ -5,18 +5,17 @@
   // Attributes for properties
   $attributes = array();
   $attributes['system:host'] = array(
-    'path' => 'system:host',
     'description' => t('System: Server Host')
   );
-  
+
   return array('attributes' => $attributes);
 }
 
 function themekey_system_themekey_global() {
   global $user;
-  
+
   $parameters = array();
   $parameters['system:host'] = $_SERVER['HTTP_HOST'];
-  
+
   return $parameters;
 }
Index: modules/themekey.locale.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/themekey/modules/themekey.locale.inc,v
retrieving revision 1.2
diff -u -r1.2 themekey.locale.inc
--- modules/themekey.locale.inc	22 Sep 2009 16:45:44 -0000	1.2
+++ modules/themekey.locale.inc	25 Sep 2009 12:15:29 -0000
@@ -5,10 +5,9 @@
   // Attributes for properties
   $attributes = array();
   $attributes['locale:language'] = array(
-    'path' => 'locale:language',
     'description' => t('Locale: Language')
   );
-  
+
   return array('attributes' => $attributes);
 }
 
@@ -16,6 +15,7 @@
   global $language;
 
   $parameters = array();
+  // REVIEW set default language instead of 'en'
   $parameters['locale:language'] = isset($language->language) ? $language->language : 'en';
 
   return $parameters;
Index: modules/themekey.taxonomy.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/themekey/modules/themekey.taxonomy.inc,v
retrieving revision 1.4
diff -u -r1.4 themekey.taxonomy.inc
--- modules/themekey.taxonomy.inc	22 Sep 2009 16:45:44 -0000	1.4
+++ modules/themekey.taxonomy.inc	25 Sep 2009 12:15:29 -0000
@@ -68,27 +68,18 @@
 
 function themekey_taxonomy_nid2vid($nid, $object = NULL) {
   $vid = array();
-  if (is_array($object) && isset($object['#raw']['taxonomy'])) {
-    foreach ($object['#raw']['taxonomy'] as $term) {
-      $vid[] = $term->vid;
-    }
-  }
-  else {
-    $result = db_query('SELECT td.vid FROM {term_data} td INNER JOIN {term_node} tn ON td.tid = tn.tid WHERE tn.nid = %d', $nid);
-    while ($term = db_fetch_object($result)) {
-      $vid[] = $term->vid;
-    }
+  // TODO use taxonomy API instead SQL
+  $result = db_query('SELECT td.vid FROM {term_data} td INNER JOIN {term_node} tn ON td.tid = tn.tid WHERE tn.nid = %d', $nid);
+  while ($term = db_fetch_object($result)) {
+    $vid[] = $term->vid;
   }
 
   return count($vid) ? $vid : FALSE;
 }
 
 function themekey_taxonomy_nid2tid($nid, $object = NULL) {
-  if (is_array($object) && isset($object['#raw']['taxonomy'])) {
-    return array_keys($object['#raw']['taxonomy']);
-  }
-
   $tid = array();
+  // TODO use taxonomy API instead SQL
   $result = db_query('SELECT tid FROM {term_node} WHERE nid = %d', $nid);
   while ($term = db_fetch_object($result)) {
     $tid[] = $term->tid;
Index: modules/themekey.node.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/themekey/modules/themekey.node.inc,v
retrieving revision 1.3
diff -u -r1.3 themekey.node.inc
--- modules/themekey.node.inc	22 Sep 2009 16:45:44 -0000	1.3
+++ modules/themekey.node.inc	25 Sep 2009 12:15:29 -0000
@@ -26,7 +26,8 @@
 
 function _themekey_node_callback(&$item, $parameters) {
   if ($node = node_load($parameters['node:nid'])) {
-    if ($theme = _themekey_match_properties($parameters, $node)) {
+    $parameters = _themekey_prepare_object($node, $parameters);
+    if ($theme = _themekey_match_properties($parameters)) {
       $item['theme'] = $theme;
     }
   }
Index: themekey_build.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/themekey/themekey_build.inc,v
retrieving revision 1.6
diff -u -r1.6 themekey_build.inc
--- themekey_build.inc	22 Sep 2009 16:45:44 -0000	1.6
+++ themekey_build.inc	25 Sep 2009 12:15:29 -0000
@@ -255,6 +255,9 @@
     if (isset($details['path'])) {
       $properties[$property] = $details['path'];
     }
+    else {
+      $properties[$property] = FALSE;
+    }
   }
   // URL argument properties
   $result = db_query('SELECT wildcards FROM {themekey_paths} WHERE custom = 0');
Index: themekey.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/themekey/themekey.install,v
retrieving revision 1.3
diff -u -r1.3 themekey.install
--- themekey.install	22 Sep 2009 16:45:44 -0000	1.3
+++ themekey.install	25 Sep 2009 12:15:29 -0000
@@ -84,3 +84,21 @@
 
   return $ret;
 }
+
+/**
+ * Implementation of hook_update_N().
+ */
+function themekey_update_6100() {
+
+  $properties = variable_get('themekey_properties', array());
+
+  foreach ($properties as $key => &$property) {
+    if (array_key_exists('path', $property) && $key === $property['path']) {
+      $property['path'] = FALSE;
+    }
+  }
+
+  variable_set('themekey_properties', $properties);
+
+  return array();
+}
Index: themekey_base.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/themekey/themekey_base.inc,v
retrieving revision 1.6
diff -u -r1.6 themekey_base.inc
--- themekey_base.inc	22 Sep 2009 16:45:44 -0000	1.6
+++ themekey_base.inc	25 Sep 2009 12:15:29 -0000
@@ -29,6 +29,8 @@
   $placeholders = array();
   $ancestors = array();
 
+  // FIXME comment/reply/47/11 is not turned into required ancestor comment/reply/#/#
+
   $number_parts = count($parts);
   $length =  $number_parts - 1;
   $end = (1 << $number_parts) - 1;
@@ -69,7 +71,9 @@
  */
 function _themekey_match_paths($path) {
   static $global_parameters = NULL;
-  //
+
+  // TODO only check path if there configured paths but not if only properties used
+
   if (!isset($global_parameters)) {
     $global_parameters = module_invoke_all('themekey_global');
   }
@@ -113,44 +117,39 @@
 /**
  * Function _themekey_prepare_object().
  */
-function _themekey_prepare_object($object) {
-  $parameters = array('#raw' => $object);
+function _themekey_prepare_object($object, $parameters) {
+  $object_array = (array)drupal_clone($object);
   $properties = variable_get('themekey_properties', array());
   foreach ($properties as $property => $details) {
-    if (($value = _themekey_property_field($object, $details['path'])) != NULL) {
+    if (($value = _themekey_get_object_property($object_array, $details['path'])) != NULL) {
       $parameters[$property] = $value;
     }
   }
-
   return $parameters;
 }
 
 /**
- * Function _themekey_property_field().
+ * Function _themekey_get_object_property().
  */
-function _themekey_property_field($value, $path) {
+function _themekey_get_object_property($object_array, $path) {
   //
   $parts = explode('/', $path);
   foreach ($parts as $part) {
-    if (is_array($value) && isset($value[$part])) {
-      $value = (array)$value[$part];
+    if (is_array($object_array) && isset($object_array[$part])) {
+      $object_array = $object_array[$part];
     }
     else {
       return NULL;
     }
   }
 
-  return is_array($value) ? array_keys($value) : $value;
+  return is_array($object_array) ? array_keys($object_array) : $object_array;
 }
 
 /**
  * Function _themekey_match_properties().
  */
-function _themekey_match_properties($parameters, $object = NULL) {
-  //
-  if (isset($object)) {
-    $parameters = _themekey_prepare_object(array_merge($parameters, (array)drupal_clone($object)));
-  }
+function _themekey_match_properties($parameters) {
   //
   $properties = variable_get('themekey_properties', array());
   foreach (array_keys($properties) as $property) {
