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
- The settings page says "API keys have been verified and are correct" even when the client was not able to connect to Mollom.
Cause
- The NETWORK_ERROR case is not handled separately by
_mollom_status()
. - In case API keys were verified as correct before, the configuration status is not updated (to account for potential downtime) — this can mean that API keys were successfully verified on a local developer machine, but can't be verified on a production site (due to a firewall), which in turn causes the inappropriate positive status message to stick.
Proposed solution
- Change
_mollom_status()
to use a cache with expiration date (instead of a variable) — re-verify once per day when API keys are valid, and once per hour in case of any kind of API key verification error. - Remove the fallback to the last known good configuration status (i.e., the downtime protection).
- Ensure that the NETWORK_ERROR status code is retained.
Notes
- Some developers are force-disabling all caches during development, which will cause an API key verification call on every page request. This cannot be prevented.
- The current variable-based status is prone to a much more problematic misconfiguration: Some developers are using the Features/Variables module to control all variables in code. In that case, the configuration status variable might not be updated at all.
Comment | File | Size | Author |
---|---|---|---|
#4 | mollom.status.4.patch | 8.02 KB | sun |
#3 | mollom.status-cache.3.patch | 2.56 KB | sun |
#1 | mollom.status-cache.1.patch | 1.74 KB | sun |
mollom.status.0.patch | 3.99 KB | sun | |
Comments
Comment #1
sunFollow-up to fix cache item IDs and a too ambiguous
cache_clear_all()
, which unintentionally invalidated way too many caches.Comment #3
sunComment #4
sunCombined backport to D6.
Comment #5
sunComment #6.0
(not verified) CreditAttribution: commentedUpdated issue summary.