Contact reporting functions missing from mollom.pages.inc

rehos - October 12, 2009 - 07:49
Project:Mollom
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Dave Reid
Status:needs work
Description

Reporting a contact submission as inappropriate by pressing the link in the e-mail fails with the following error message:

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'mollom_report_contact' was given in ...../includes/form.inc on line 371.

The item is declared at line 89 (code snippet below) of the file mollom.module. However the file mollom.pages.inc doesn't contain the function mollom_report_contact.

  $items['mollom/contact'] = array(
    'title' => 'Report',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('mollom_report_contact'),
    'access callback' => '_mollom_access',
    'file' => 'mollom.pages.inc',
    'type' => MENU_CALLBACK,
  );

I'am using mollom version 6.x.1.10 with Drupal 6.14.

#1

Dave Reid - October 13, 2009 - 19:59
Title:Reporting a contact submission as inappropriate by pressing the link in the e-mail fails» Contact reporting functions missing from mollom.pages.inc
Version:6.x-1.10» 6.x-1.x-dev
Priority:normal» critical
Assigned to:Anonymous» Dave Reid
Status:active» needs review

Thank you for reporting this. Apparently when we split the code into mollom.admin.inc and mollom.pages.inc, we lost the contact reporting functions. Since we didn't have tests covering the reporting paths, we never noticed this. Please review the attached patch. I'm working on revising most of the test logic for cleaner and re-usable tests and adding tests for all the report pages is a huge priority now.

AttachmentSize
602044-mollom-contact-report-missing-D6.patch 5.28 KB

#2

Dave Reid - October 15, 2009 - 03:48
Status:needs review» needs work

Committed to CVS. Leaving as needs work until tests can be written for this. Still a high priority to complete.

#3

rehos - October 16, 2009 - 08:40

Thanks for supplying the patch. The patch works great. I have tested the patch for reporting inappropriate contact submissions.

 
 

Drupal is a registered trademark of Dries Buytaert.