Index: mollom.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.admin.inc,v
retrieving revision 1.41
diff -u -p -r1.41 mollom.admin.inc
--- mollom.admin.inc	26 Sep 2010 19:42:55 -0000	1.41
+++ mollom.admin.inc	28 Sep 2010 16:45:41 -0000
@@ -307,7 +307,9 @@ function mollom_admin_unprotect_form($fo
  * Form submit handler for mollom_admin_unprotect_form().
  */
 function mollom_admin_unprotect_form_submit($form, &$form_state) {
-  db_delete('mollom_form')->condition('form_id', $form_state['values']['mollom']['form_id'])->execute();
+  mollom_form_delete($form_state['values']['mollom']['form_id']);
+
+  drupal_set_message(t('The form protection has been removed.'));
 
   $form_state['redirect'] = 'admin/config/content/mollom';
 }
Index: mollom.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.module,v
retrieving revision 1.85
diff -u -p -r1.85 mollom.module
--- mollom.module	25 Sep 2010 01:05:41 -0000	1.85
+++ mollom.module	28 Sep 2010 16:40:04 -0000
@@ -580,7 +580,7 @@ function mollom_data_report_multiple($en
  * necessary.
  */
 function mollom_form_alter(&$form, &$form_state, $form_id) {
-  $forms = &drupal_static(__FUNCTION__);
+  $forms = &drupal_static('mollom_form_cache');
 
   // Skip installation and update forms.
   if (defined('MAINTENANCE_MODE')) {
@@ -682,6 +682,7 @@ function mollom_form_cache($reset = FALS
     // This catches both 'mollom_form_cache' as well as mollom_form_load()'s
     // 'mollom:form:*' entries.
     cache_clear_all('mollom', 'cache', TRUE);
+    drupal_static_reset('mollom_form_cache');
     return;
   }
 
@@ -848,6 +849,23 @@ function mollom_form_save(&$mollom_form)
 }
 
 /**
+ * Deletes a Mollom form configuration.
+ */
+function mollom_form_delete($form_id) {
+  $mollom_form = mollom_form_load($form_id);
+
+  db_delete('mollom_form')
+    ->condition('form_id', $form_id)
+    ->execute();
+
+  // Allow modules to react on saved form configurations.
+  module_invoke_all('mollom_form_delete', $mollom_form);
+
+  // Flush cached Mollom forms and the Mollom form mapping cache.
+  mollom_form_cache(TRUE);
+}
+
+/**
  * Given an array of values and an array of fields, extract data for use.
  *
  * This function generates the data to send for validation to Mollom by walking
Index: tests/mollom.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/tests/mollom.test,v
retrieving revision 1.64
diff -u -p -r1.64 mollom.test
--- tests/mollom.test	26 Sep 2010 19:42:55 -0000	1.64
+++ tests/mollom.test	28 Sep 2010 16:49:11 -0000
@@ -1797,6 +1797,28 @@ class MollomFormConfigurationTestCase ex
     // Verify that the form was not submitted and cannot be submitted.
     $this->assertNoText('Successful form submission.');
     $this->assertText($this->spam_message);
+
+    // Verify that we can remove the form protection.
+    $this->drupalLogin($this->admin_user);
+    $this->drupalGet('admin/config/content/mollom');
+    $this->assertText('Mollom test form');
+
+    $this->drupalPost('admin/config/content/mollom/unprotect/mollom_test_form', array(), t('Confirm'));
+    $this->assertUrl('admin/config/content/mollom');
+    $this->assertNoText('Mollom test form');
+    $this->assertText(t('The form protection has been removed.'));
+    $mollom_form = mollom_form_load('mollom_test_form');
+    $this->assertFalse($mollom_form, t('Form protection not found.'));
+
+    // Verify that the form is no longer protected.
+    $this->drupalLogout();
+    $edit = array(
+      'title' => 'unsure',
+    );
+    $this->drupalPost('mollom-test/form', $edit, 'Submit');
+    $this->assertText('Successful form submission.');
+    $this->assertNoText($this->unsure_message);
+    $this->assertNoCaptchaField();
   }
 
   /**
