Closed (fixed)
Project:
Mollom
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
18 Apr 2010 at 21:37 UTC
Updated:
20 May 2010 at 14:40 UTC
Jump to comment: Most recent file
SELECT * FROM mollom_form WHERE form_id = 'note_node_form' LIMIT 0, 1
This query gets called for every node on node listing pages. The forms aren't even being displayed, so there's nothing to protect, and in any case, some static caching could be used to prevent the redundant queries.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 774816-mollom-cache-get-mode-D6.patch | 974 bytes | dave reid |
Comments
Comment #1
dave reidComment #2
dave reidThe query comes from the code to add the 'report to Mollom' links in mollom_link(). We should add some caching to either mollom_get_mode() or mollom_load_form() so that this does not need to be loaded on every, single call to mollom_get_mode().
Comment #3
dave reidPatch to statically cache mollom_get_mode(). Helped reduce the number of queries just to the number of unique node types on a node display.
Does not apply to D7 since we do not have mollom_get_mode() or use links in that verison.
Comment #4
sunBasically, this static caching rather belongs into mollom_form_load(). But for now, I'd move forward with this patch here, because entire loading/caching will need to get changed via #717874: Provide exportables for Mollom forms
Comment #5
dries commentedDoes that mean we should add a todo?
Comment #6
sunI don't think so... the exportables issue is enough of a todo. Not sure about CTools/Features' status for D7, but ideally, exportables support should only be added there.
Comment #7
dave reidAnyone want to mark as RTBC then? :)
Comment #8
sunComment #9
dries commentedmollom_form_load()is documented to be a menu loader but it is obviously used in different contexts too.$mollom_forminmollom_form_load(), it seems. See the following snippet taken frommollom_form_load():I haven't tested it but it seems like we might be able to add a
'mode' => MOLLOM_MODE_DISABLED.Comment #10
dave reidI think the problem with adding a default in mollom_form_load() is that function could return FALSE if the form_id is not provided by any hook_mollom_form_info(). Therefore we would still have to check if $mollom_form is FALSE in mollom_get_mode().\
Plus, that default value is actually loaded in mollom_form_info().
Comment #11
dave reidCommitted #3 to DRUPAL-6--1.
http://drupal.org/cvs?commit=363636
Comment #12
dries commentedActually, this needs to be ported to CVS HEAD (Drupal 7) before it can be marked 'fixed'. Let's try to keep CVS HEAD in sync.
Comment #13
dave reidThe mollom_get_mode() function isn't in the D7 branch since we don't add the 'Report to Mollom' links. :)