Index: mollom.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.admin.inc,v
retrieving revision 1.1.2.38
diff -u -p -r1.1.2.38 mollom.admin.inc
--- mollom.admin.inc	14 Sep 2010 20:28:45 -0000	1.1.2.38
+++ mollom.admin.inc	15 Sep 2010 00:50:47 -0000
@@ -329,11 +329,6 @@ function mollom_admin_blacklist_form(&$f
     'links' => t('Links'),
     'author' => t('Author name'),
   );
-  $reasons = array(
-    'spam' => t('Spam'),
-    'profanity' => t('Profanity'),
-    'unwanted' => t('Unwanted'),
-  );
 
   $form['blacklist'] = array();
   // Do not retrieve the current blacklist when submitting the form.
@@ -346,11 +341,16 @@ function mollom_admin_blacklist_form(&$f
       $row = array(
         'context' => array('#value' => check_plain($contexts[$entry['context']])),
         'text' => array('#value' => check_plain($entry['text'])),
-        'reason' => array('#value' => check_plain($reasons[$entry['reason']])),
         'text' => array('#value' => check_plain($entry['text'])),
       );
+      $delete_url_parts = array(
+        'admin/settings/mollom/blacklist/delete',
+        base64_encode($entry['text']),
+        $entry['context'],
+        $entry['reason'],
+      );
       $row['actions']['delete'] = array(
-        '#value' => l(t('delete'), 'admin/settings/mollom/blacklist/delete/' .  base64_encode($entry['text']), array('query' => drupal_get_destination())),
+        '#value' => l(t('delete'), implode('/', $delete_url_parts), array('query' => drupal_get_destination())),
       );
       $form['blacklist'][$id] = $row;
     }
@@ -369,10 +369,8 @@ function mollom_admin_blacklist_form(&$f
     '#maxlength' => 64,
   );
   $form['entry']['reason'] = array(
-    '#type' => 'select',
-    '#options' => $reasons,
-    '#default_value' => $type,
-    '#required' => TRUE,
+    '#type' => 'value',
+    '#value' => $type,
   );
   $form['entry']['actions'] = array(
     '#tree' => FALSE,
@@ -406,27 +404,24 @@ function theme_mollom_admin_blacklist_fo
   $header = array(
     t('Context'),
     t('Text'),
-    t('Reason'),
     '',
   );
   $rows = array();
 
+  $rows[] = array(
+    drupal_render($form['entry']['context']),
+    drupal_render($form['entry']['text']),
+    drupal_render($form['entry']['actions']),
+  );
+
   foreach (element_children($form['blacklist']) as $id) {
     $rows[] = array(
       drupal_render($form['blacklist'][$id]['context']),
       drupal_render($form['blacklist'][$id]['text']),
-      drupal_render($form['blacklist'][$id]['reason']),
       drupal_render($form['blacklist'][$id]['actions']),
     );
   }
 
-  $rows[] = array(
-    drupal_render($form['entry']['context']),
-    drupal_render($form['entry']['text']),
-    drupal_render($form['entry']['reason']),
-    drupal_render($form['entry']['actions']),
-  );
-
   // This table is never empty due to the form.
   $output  = theme('table', $header, $rows);
   $output .= drupal_render($form);
@@ -437,15 +432,34 @@ function theme_mollom_admin_blacklist_fo
 /**
  * Form builder; Builds the confirmation form for deleting a blacklist item.
  *
+ * @param $key
+ *   The blacklist entry text to remove, base64-encoded.
+ * @param $context
+ *   The context of the blacklist entry.
+ * @param $reason
+ *   The reason of the blacklist entry.
+ *
  * @ingroup forms
  * @see mollom_admin_blacklist_delete_submit()
  */
-function mollom_admin_blacklist_delete(&$form_state, $key) {
-  $form['#mollom-blacklist-text'] = base64_decode($key);
+function mollom_admin_blacklist_delete(&$form_state, $key, $context, $reason) {
+  $text = base64_decode($key);
+  $form['text'] = array(
+    '#type' => 'value',
+    '#value' => $text,
+  );
+  $form['context'] = array(
+    '#type' => 'value',
+    '#value' => $context,
+  );
+  $form['reason'] = array(
+    '#type' => 'value',
+    '#value' => $reason,
+  );
 
   return confirm_form(
     $form,
-    t('Are you sure you want to delete %text from the blacklist?', array('%text' => $form['#mollom-blacklist-text'])),
+    t('Are you sure you want to delete %text from the blacklist?', array('%text' => $text)),
     'admin/settings/mollom/blacklist',
     t('This action cannot be undone.'),
     t('Delete'), t('Cancel')
@@ -456,7 +470,12 @@ function mollom_admin_blacklist_delete(&
  * Form submit handler to delete an entry from the blacklist.
  */
 function mollom_admin_blacklist_delete_submit($form, &$form_state) {
-  $result = mollom('mollom.removeBlacklistText', array('text' => $form['#mollom-blacklist-text']));
+  $data = array(
+    'text' => $form_state['values']['text'],
+    'context' => $form_state['values']['context'],
+    'reason' => $form_state['values']['reason'],
+  );
+  $result = mollom('mollom.removeBlacklistText', $data);
 
   if ($result === TRUE) {
     drupal_set_message(t('The entry was removed from the blacklist.'));
Index: mollom.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.module,v
retrieving revision 1.2.2.165
diff -u -p -r1.2.2.165 mollom.module
--- mollom.module	14 Sep 2010 20:28:45 -0000	1.2.2.165
+++ mollom.module	15 Sep 2010 01:08:03 -0000
@@ -286,7 +286,7 @@ function mollom_menu() {
   $items['admin/settings/mollom/blacklist/delete'] = array(
     'title' => 'Delete',
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('mollom_admin_blacklist_delete', 5),
+    'page arguments' => array('mollom_admin_blacklist_delete'),
     'access arguments' => array('administer mollom'),
     'type' => MENU_CALLBACK,
     'file' => 'mollom.admin.inc',
Index: tests/mollom.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/tests/mollom.test,v
retrieving revision 1.1.2.59
diff -u -p -r1.1.2.59 mollom.test
--- tests/mollom.test	14 Sep 2010 20:28:45 -0000	1.1.2.59
+++ tests/mollom.test	14 Sep 2010 23:21:44 -0000
@@ -1410,25 +1410,44 @@ class MollomBlacklistTestCase extends Mo
   function testBlacklistUI() {
     // Log in as an administrator and access the blacklist administration page.
     $this->drupalLogin($this->admin_user);
-    $this->drupalGet('admin/settings/mollom/blacklist');
 
-    // Add a word to the text blacklist.
+    // Add a word to the spam blacklist.
+    $this->drupalGet('admin/settings/mollom/blacklist');
     $text = $this->randomName();
     $edit = array(
       'entry[context]' => 'everything',
       'entry[text]' => $text,
-      'entry[reason]' => 'spam',
     );
     $this->drupalPost(NULL, $edit, t('Add'));
     $this->assertText(t('The entry was added to the blacklist.'));
     $this->assertText($text);
 
-    // Remove the word from the text blacklist.
-    $delete_url = 'admin/settings/mollom/blacklist/delete/' . base64_encode($text);
+    // Remove the word from the spam blacklist.
+    $links = $this->xpath('//td[contains(., "' . $text . '")]/following-sibling::td/a');
+    $delete_url = $GLOBALS['base_url'] . (string) $links[0]['href'];
     $this->drupalGet($delete_url);
     $this->drupalPost(NULL, array(), t('Delete'));
     $this->assertEqual($this->getUrl(), url('admin/settings/mollom/blacklist', array('absolute' => TRUE)), t('Correct page redirection.'));
     $this->assertNoText($text, 'Text blacklist removed.');
+
+    // Add a word to the profanity blacklist.
+    $this->drupalGet('admin/settings/mollom/blacklist/profanity');
+    $text = $this->randomName();
+    $edit = array(
+      'entry[context]' => 'everything',
+      'entry[text]' => $text,
+    );
+    $this->drupalPost(NULL, $edit, t('Add'));
+    $this->assertText(t('The entry was added to the blacklist.'));
+    $this->assertText($text);
+
+    // Remove the word from the profanity blacklist.
+    $links = $this->xpath('//td[contains(., "' . $text . '")]/following-sibling::td/a');
+    $delete_url = $GLOBALS['base_url'] . (string) $links[0]['href'];
+    $this->drupalGet($delete_url);
+    $this->drupalPost(NULL, array(), t('Delete'));
+    $this->assertEqual($this->getUrl(), url('admin/settings/mollom/blacklist/profanity', array('absolute' => TRUE)), t('Correct page redirection.'));
+    $this->assertNoText($text, 'Text blacklist removed.');
   }
 }
 
