Index: mollom.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.install,v retrieving revision 1.2.2.35 diff -u -p -r1.2.2.35 mollom.install --- mollom.install 16 Oct 2010 18:24:54 -0000 1.2.2.35 +++ mollom.install 28 Oct 2010 00:50:06 -0000 @@ -113,13 +113,6 @@ function mollom_schema() { 'not null' => TRUE, 'default' => 0, ), - 'moderate' => array( - 'description' => 'Whether the content needs to be moderated.', - 'type' => 'int', - 'size' => 'tiny', - 'not null' => TRUE, - 'default' => 0, - ), // Server response columns are NULL by default, because any default value // would have an unintended meaning. Also, values are stored in individual // columns, so as to be able to join and filter/sort on these values for @@ -623,14 +616,16 @@ function mollom_update_6117() { 'default' => 1, )); } - if (!db_column_exists('mollom', 'moderate')) { - db_add_field($ret, 'mollom', 'moderate', array( - 'description' => 'Whether the content needs to be moderated.', - 'type' => 'int', - 'size' => 'tiny', - 'not null' => TRUE, - 'default' => 0, - )); + return $ret; +} + +/** + * Remove the {mollom}.moderate column introduced in mollom_update_6117(). + */ +function mollom_update_6118() { + $ret = array(); + if (db_column_exists('mollom', 'moderate')) { + db_drop_field($ret, 'mollom', 'moderate'); } return $ret; } Index: mollom.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/mollom/mollom.module,v retrieving revision 1.2.2.178 diff -u -p -r1.2.2.178 mollom.module --- mollom.module 18 Oct 2010 14:04:54 -0000 1.2.2.178 +++ mollom.module 28 Oct 2010 00:51:20 -0000 @@ -470,29 +470,6 @@ function mollom_data_save($data) { } /** - * Updates stored Mollom session data to mark a bad post as moderated. - * - * @param $entity - * The entity type of the moderated post. - * @param $id - * The entity id of the moderated post. - */ -function mollom_data_moderate($entity, $id) { - $data = mollom_data_load($entity, $id); - // Nothing to do, if no data exists. - if (!$data) { - return; - } - - // Report the session to Mollom. - _mollom_send_feedback($data->session_id, 'ham'); - - // Mark the session data as moderated. - $data->moderate = 0; - mollom_data_save($data); -} - -/** * Deletes a Mollom session data record from the database. * * @param $entity @@ -1807,8 +1784,6 @@ function mollom_form_submit($form, &$for $data->entity = $form_state['mollom']['entity']; $data->id = $values['post_id']; $data->form_id = $form_state['mollom']['form_id']; - // Set the moderation flag for forms accepting bad posts. - $data->moderate = $form_state['mollom']['require_moderation']; mollom_data_save($data); } } @@ -2348,8 +2323,6 @@ function mollom_nodeapi($node, $op) { $data->entity = 'node'; $data->id = $node->nid; $data->form_id = $mollom['form_id']; - // Set the moderation flag for forms accepting bad posts. - $data->moderate = $mollom['require_moderation']; mollom_data_save($data); } elseif ($op == 'delete') { @@ -2365,17 +2338,6 @@ function node_mollom_form_moderation(&$f } /** - * Implements hook_node_presave(). - */ -function mollom_node_presave($comment) { - // If an existing node is published and we have session data stored for it, - // mark the data as moderated. - if (!empty($node->nid) && $node->status) { - mollom_data_moderate('node', $node->nid); - } -} - -/** * Implements hook_form_FORMID_alter(). * * Hook into the mass comment administration page and add some operations to @@ -2516,27 +2478,8 @@ function mollom_comment($comment, $op) { $data->entity = 'comment'; $data->id = (isset($comment['cid']) ? $comment['cid'] : $comment->cid); $data->form_id = $mollom['form_id']; - // Set the moderation flag for forms accepting bad posts. - $data->moderate = $mollom['require_moderation']; mollom_data_save($data); } - // If an existing comment is published and we have session data stored for it, - // mark the data as moderated. Since Drupal 6 does not expose a - // hook_comment_presave(), the operation needs to be performed in the update - // case. In case a comment is updated through a comment form submission, this - // may mean that above code will insert or update the data, and the following - // code may update it again. However, the resulting logic is easier to follow - // this way. - if ($op == 'publish') { - if (is_array($comment)) { - if (!empty($comment['cid'])) { - mollom_data_moderate('comment', $comment['cid']); - } - } - elseif (!empty($comment->cid)) { - mollom_data_moderate('comment', $comment->cid); - } - } if ($op == 'delete') { mollom_data_delete('comment', $comment->cid); } Index: tests/mollom.test =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/mollom/tests/mollom.test,v retrieving revision 1.1.2.71 diff -u -p -r1.1.2.71 mollom.test --- tests/mollom.test 25 Oct 2010 15:41:30 -0000 1.1.2.71 +++ tests/mollom.test 28 Oct 2010 00:51:47 -0000 @@ -2653,7 +2653,6 @@ class MollomAnalysisTestCase extends Mol $record = mollom_test_load($mid); $this->assertEqual($record['status'], 0, t('Unpublished test post found.')); $this->assertSame('spam', $data->spam, MOLLOM_ANALYSIS_SPAM); - $this->assertSame('moderate', $data->moderate, 1); // Verify that editing the post does neither change the session data, nor // the publishing status. @@ -2667,7 +2666,6 @@ class MollomAnalysisTestCase extends Mol $record = mollom_test_load($mid); $this->assertEqual($record['status'], 0, t('Unpublished test post found.')); $this->assertSame('spam', $data->spam, MOLLOM_ANALYSIS_SPAM); - $this->assertSame('moderate', $data->moderate, 1); // Verify that publishing the post changes the session data accordingly. $this->drupalLogin($this->admin_user); @@ -2680,7 +2678,6 @@ class MollomAnalysisTestCase extends Mol $record = mollom_test_load($mid); $this->assertEqual($record['status'], 1, t('Published test post found.')); $this->assertSame('spam', $data->spam, MOLLOM_ANALYSIS_SPAM); - $this->assertSame('moderate', $data->moderate, 0); // Verify that neither ham or unsure spam posts, nor non-profane posts are // marked for moderation. @@ -2704,7 +2701,6 @@ class MollomAnalysisTestCase extends Mol $record = mollom_test_load($mid); $this->assertEqual($record['status'], 1, t('Published test post %body found.', array('%body' => $body))); $this->assertSame('spam', $data->spam, $expected['spam']); - $this->assertSame('moderate', $data->moderate, 0); } }