--- formblock.module	2009-12-04 11:33:22.000000000 +1100
+++ formblock.module	2010-12-24 16:06:00.000000000 +1100
@@ -28,6 +28,10 @@ function formblock_form_alter(&$form, $f
       '#dependency' => array('edit-formblock-expose' => array('1')),
     );
   }
+  if (formblock_current_form() == $form_id) {
+    // Let other modules know this form is being displayed in a block.
+    $form['#formblock'] = TRUE;
+  }
 }
 
 /**
@@ -68,10 +72,13 @@ function formblock_block($op = 'list', $
           // Don't display the form to logged in users or if registration is disabled
           if (!$user->uid && variable_get('user_register', 1)) {
             drupal_add_css(drupal_get_path('module', 'formblock'). '/formblock.css', 'module', 'all');
-            return array(
+            formblock_current_form('set', $delta);
+            $block = array(
               'subject' => t('Create new account'),
               'content' => drupal_get_form('user_register')
             );
+            formblock_current_form('set');
+            return $block;
           }
           break;
 
@@ -81,10 +88,13 @@ function formblock_block($op = 'list', $
           if (!$user->uid) {
             drupal_add_css(drupal_get_path('module', 'formblock'). '/formblock.css', 'module', 'all');
             module_load_include('inc', 'user', 'user.pages');
-            return array(   
+            formblock_current_form('set', $delta);
+            $block = array(   
               'subject' => t('Request new password'),
               'content' => drupal_get_form('user_pass'),
             );
+            formblock_current_form('set');
+            return $block;
           }
           break;
 
@@ -98,16 +108,21 @@ function formblock_block($op = 'list', $
               module_load_include('inc', 'contact', 'contact.pages');
               $content = drupal_get_form('contact_mail_page');
             }
-            return array(
+            formblock_current_form('set', $delta);
+            $block = array(
               'subject' => t('Contact'),
               'content' => $content,
             );
+            formblock_current_form('set');
+            return $block;
           }
           break;
 
         default:
-          return formblock_get_block($delta);
-
+          formblock_current_form('set', $delta);
+          $block = formblock_get_block($delta);
+          formblock_current_form('set');
+          return $block;
     }
   }
 }
@@ -166,4 +181,24 @@ function formblock_dependent_process($el
   }
 
   return $element;
+}
+
+/**
+ * Statically caches the current form being presented in a block so that we can give the node
+ * object context.
+ *
+ * @param string $op
+ *  set: Statically caches the second paramater
+ *  get: ignores the second paramater
+ * @param string $form_id
+ *  Form ID string. Ignored if $op == 'get'
+ * @return string
+ *  Current cached form ID
+ */
+function formblock_current_form($op = 'get', $form_id = NULL) {
+  static $current_form;
+  if ($op == 'set') {
+    $current_form = $form_id;
+  }
+  return $current_form;
 }
\ No newline at end of file
