I have a custom content type that I created and when I use the body field as the main content entry field it submits it to Mollom as

Spam content here

as shown in the logs.

This appears to prevent developer mode from working too.

Comments

elijah lynn’s picture

Title: Submits content to Mollom as "<p>Spam content</p> » Submits content to Mollom as "<p>Spam content</p>"

<p>Spam content here</p>

Submits to Mollom like that. Normal mode or dev mode does not work.

dave reid’s picture

Status: Active » Postponed (maintainer needs more info)

That is really odd. There is no such string 'Spam content here' in the mollom module/codebase. Maybe some other module is adding this?

nielt’s picture

I believe what ElijahLynn meant was that "Spam content here" is just dummy text for whatever the user put into the field being checked by Mollom. (in the original post the paragraph tags were parsed by the input filters of drupal.org)

What ElijahLynn is refering to is that when a custom content type is set for text analysis, Mollom almost always replies with the "unsure" state and thus the user has to fill in a CAPTCHA.

I can confirm this problem, and believe it happens because of the way the content of custom node types is prepared for text analysis:

  // Render the node so that all visible fields are prepared and
  // concatenated:
  $data = node_build_content((object)$form_state, FALSE, FALSE);
  $content = drupal_render($data->content);

We are sending a whole lot of html to Mollom in the body for analysis, instead of just the raw input of the node creation form. This triggers the unsure state most of the time.

A solution would be to just concatenate $form_state['form_element_name'] for all the form elements, without rendering the content. The problem here is that we do not know what the names of the form elements are (because it is for custom node types). I'm not sure, but couldn't we get the array of form elements with drupal_retrieve_form() and then loop over the form element array ignoring the 'title' and 'submit' elements, to get all the element names?

dries’s picture

Status: Postponed (maintainer needs more info) » Needs work

smautf is right in #3. The node_build_content() adds unwanted markup. The node_build_content() should probably be replaced with some other string concatenation solution. This issue might automatically go away when we commit #245682: Enable use of Mollom for any form.

dave reid’s picture

Status: Needs work » Closed (works as designed)

Marking this as by design. Please keep posted to #245682: Enable use of Mollom for any form as this process will change with concatenation instead of the current node building process.