Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#8 | mollom.fba_exit.d6.8.patch | 411 bytes | eshta |
#3 | mollom.fbajs_.d6.3.patch | 5.89 KB | eshta |
mollom.fbajs_.0.patch | 6.25 KB | eshta | |
Comments
Comment #1
eshta CreditAttribution: eshta commentedComment #3
eshta CreditAttribution: eshta commentedBackporting...
Comment #4
eshta CreditAttribution: eshta commentedComment #7
splash112 CreditAttribution: splash112 commentedHi 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...
Comment #8
eshta CreditAttribution: eshta commentedHi 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 :-)
Comment #9
eshta CreditAttribution: eshta commentedPatch applied to 6.x-2.x. Thanks for pointing this one out.
Comment #12
splash112 CreditAttribution: splash112 commented@eshta
Many thanks ! Sorry, away from d.o for a couple of weeks. Many thanks for the fix!