Problem

  • When form behavior analysis is enabled on a site with anonymous user page caching, the first value retrieved from Mollom is used for all users.

Possible Solution

  • Implement behavior image loading and tracking id values on the client-side so that they are not populated until the form is requested.
  • The same server-side processing logic still applies.
  • Only request an image if the image hasn't already been requested.

Drawbacks

  • This means that there will be no form behavior analysis token requested for any users with javascript disabled. Instead we will indicate to Mollom that there is no value included by passing -1.
    • This includes most spambots.
    • This does not disproportionately affect screen readers as they have about the same percentage of javascript disabled users.
  • We can no longer test fba functionality as well as it will be client-side but we can still test a lot of it.
  • This is better than the alternative which is to break page caching for any page with a Mollom-enabled form.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eshta’s picture

Issue summary: View changes

  • Commit ede2497 on 7.x-2.x by eshta:
    Issue #2249043 by eshta: Converted form behavior analysis to client-side...
eshta’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev
FileSize
5.89 KB

Backporting...

eshta’s picture

Status: Needs review » Fixed

  • Commit 8f236cf on 6.x-2.x by eshta:
    Issue #2249043 by eshta: Converted form behavior analysis to client-side...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

splash112’s picture

Hi All,

Thanks for the great work! Check my log files and seem to get some errors from D6 Mollom.
PHP Fatal error: Call to undefined function drupal_exit() in /sites/all/modules/mollom/mollom.module on line 1846

Think this patch added drupal_exit() to function mollom_fba_js(). As far as I can see drupal_exit() was introduced in Drupal 7, hence the error.

Sadly no idea how to fix...

eshta’s picture

Status: Closed (fixed) » Needs review
FileSize
411 bytes

Hi there,

Thanks for reporting this. I think I found an appropriate way to handle this in D6. I followed the approach for D6 here: http://clikfocus.com/blog/simple-ajax-example-drupal-6-and-7

The patch is attached.

@splash112 Would love it if you could confirm before I commit it :-)

eshta’s picture

Status: Needs review » Fixed

Patch applied to 6.x-2.x. Thanks for pointing this one out.

  • eshta committed 330296f on 6.x-2.x
    Issue #2249043 by eshta: Replaced drupal_exit with Drupal 6 appropriate...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

splash112’s picture

@eshta
Many thanks ! Sorry, away from d.o for a couple of weeks. Many thanks for the fix!