Index: mollom.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.admin.inc,v
retrieving revision 1.36
diff -u -p -r1.36 mollom.admin.inc
--- mollom.admin.inc	14 Sep 2010 20:27:25 -0000	1.36
+++ mollom.admin.inc	16 Sep 2010 16:56:39 -0000
@@ -327,11 +327,6 @@ function mollom_admin_blacklist_form($fo
     '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.
@@ -344,13 +339,17 @@ function mollom_admin_blacklist_form($fo
       $row = array(
         'context' => array('#markup' => check_plain($contexts[$entry['context']])),
         'text' => array('#markup' => check_plain($entry['text'])),
-        'reason' => array('#markup' => check_plain($reasons[$entry['reason']])),
-        'text' => array('#markup' => 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(
         '#type' => 'link',
         '#title' => t('delete'),
-        '#href' => 'admin/config/content/mollom/blacklist/delete/' .  base64_encode($entry['text']),
+        '#href' => implode('/', $delete_url_parts),
         '#options' => array(
           'query' => drupal_get_destination(),
         ),
@@ -372,10 +371,8 @@ function mollom_admin_blacklist_form($fo
     '#maxlength' => 64,
   );
   $form['entry']['reason'] = array(
-    '#type' => 'select',
-    '#options' => $reasons,
-    '#default_value' => $type,
-    '#required' => TRUE,
+    '#type' => 'value',
+    '#value' => $type,
   );
   $form['entry']['actions'] = array(
     '#type' => 'actions',
@@ -411,27 +408,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', array('header' => $header, 'rows' => $rows));
   $output .= drupal_render_children($form);
@@ -442,15 +436,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, &$form_state, $key) {
-  $form['#mollom-blacklist-text'] = base64_decode($key);
+function mollom_admin_blacklist_delete($form, &$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/config/content/mollom/blacklist',
     t('This action cannot be undone.'),
     t('Delete'), t('Cancel')
@@ -461,7 +474,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.79
diff -u -p -r1.79 mollom.module
--- mollom.module	16 Sep 2010 16:53:29 -0000	1.79
+++ mollom.module	16 Sep 2010 16:57:06 -0000
@@ -259,7 +259,7 @@ function mollom_menu() {
   $items['admin/config/content/mollom/blacklist/delete'] = array(
     'title' => 'Delete',
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('mollom_admin_blacklist_delete', 6),
+    '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.58
diff -u -p -r1.58 mollom.test
--- tests/mollom.test	14 Sep 2010 18:43:50 -0000	1.58
+++ tests/mollom.test	16 Sep 2010 17:00:48 -0000
@@ -1427,26 +1427,46 @@ 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/config/content/mollom/blacklist');
 
-    // Add a word to the text blacklist.
+    // Add a word to the spam blacklist.
+    $this->drupalGet('admin/config/content/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/config/content/mollom/blacklist/delete/' . base64_encode($text);
+    // Remove the word from the spam blacklist.
+    $links = $this->xpath('//td[contains(., :text)]/following-sibling::td/a', array(':text' => $text));
+    $delete_url = $GLOBALS['base_root'] . (string) $links[0]['href'];
     $this->assertLinkByHref(url($delete_url));
     $this->drupalGet($delete_url);
     $this->drupalPost(NULL, array(), t('Delete'));
     $this->assertEqual($this->getUrl(), url('admin/config/content/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/config/content/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', array(':text' => $text));
+    $delete_url = $GLOBALS['base_root'] . (string) $links[0]['href'];
+    $this->assertLinkByHref(url($delete_url));
+    $this->drupalGet($delete_url);
+    $this->drupalPost(NULL, array(), t('Delete'));
+    $this->assertEqual($this->getUrl(), url('admin/config/content/mollom/blacklist/profanity', array('absolute' => TRUE)), t('Correct page redirection.'));
+    $this->assertNoText($text, 'Text blacklist removed.');
   }
 }
 
