Index: fasttoggle.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/fasttoggle/fasttoggle.module,v
retrieving revision 1.9
diff -u -r1.9 fasttoggle.module
--- fasttoggle.module	26 Feb 2008 22:20:35 -0000	1.9
+++ fasttoggle.module	27 Feb 2008 17:54:13 -0000
@@ -132,6 +132,22 @@
   }
 }
 
+/**
+ * Enable modules to add properties to comments through hook_comment().
+ *
+ * To support toggling, a property needs to be loaded onto the base object.
+ * hook_nodeapi() and hook_user() support a 'load' op but _comment_load()
+ * loads data only from the comments table. This function allows modules
+ * to load properties onto comments through a 'load' op in hook_comment()
+ * and hence to produce custom comment properties that support toggling.
+ */
+function fasttoggle_load_comment(&$comment) {
+  if ($extra = comment_invoke_comment($comment, 'load')) {
+    foreach ($extra as $key => $value) {
+      $comment->$key = $value;
+    }
+  }
+}
 
 /**
  * Return an array of toggleable options of the object and the name of each state.
@@ -237,6 +253,7 @@
         }
         break;
       case 'comment':
+        fasttoggle_load_comment($obj);
         foreach (array_keys($options) as $key) {
           $links['fasttoggle_'. $key] = fasttoggle($options[$key][intval($obj->$key)], 'comment/toggle/'. $obj->cid .'/'. $key, false, $key .'_'. $obj->cid);
         }
Index: fasttoggle.toggle.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/fasttoggle/fasttoggle.toggle.inc,v
retrieving revision 1.1
diff -u -r1.1 fasttoggle.toggle.inc
--- fasttoggle.toggle.inc	7 Oct 2007 12:44:04 -0000	1.1
+++ fasttoggle.toggle.inc	27 Feb 2008 17:57:35 -0000
@@ -119,6 +119,7 @@
  * POST. Otherwise, display a confirmation form.
  */
 function fasttoggle_comment_option($comment, $option) {
+  fasttoggle_load_comment($comment);
   $options = fasttoggle_get_options('comment', $comment);
 
   // Check if the action is valid. This is essential to ensure the user has
