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.
mollom_field_extra_fields() does a mollom_form_load() for each node type. On the Drupal 7 site I'm working on that's around half the SQL queries executed on node/n.
Comment | File | Size | Author |
---|---|---|---|
#14 | mollom-HEAD.field-extra-fields-todo.14.patch | 1.65 KB | sun |
#9 | mollom-HEAD.field-extra-fields.9.patch | 2.12 KB | sun |
#8 | mollom-HEAD.field-extra-fields.8.patch | 2.04 KB | sun |
#6 | mollom-HEAD.field-extra-fields.6.patch | 1.94 KB | sun |
#3 | mollom-HEAD.field-extra-fields.3.patch | 1.49 KB | sun |
Comments
Comment #2
catchCan't reproduce the test failure locally.
Comment #3
sunwow, what a mess.
Comment #5
Dries CreditAttribution: Dries commentedIf it is such a mess, does it need to be removed altogether? Or what needs to be done so we don't have to guess?
It sounds like a reasonably common use case to me so it is hard to believe Mollom is the only module that has this problem.
Comment #6
sunHm. Now I see that http://api.drupal.org/api/function/hook_field_extra_fields/7 does not even get those arguments I mistakenly thought it would get...
Problem space being that
1) entity modules registering their _forms_ for possible protection with Mollom
2) user enables/configures any of those registered entity forms
3) Mollom appears on the entity forms as extra field, but only because we integrate with the form_id
4) There is no reverse-relationship from entity -> bundle -> form_id...
On a second thought. Let's try this. Gotta get some dinner now, will come back to this later.
Comment #7
Dries CreditAttribution: Dries commentedI'll postpone testing this given that it has a @todo and per the comment in #6 it might just be a work in progress.
Comment #8
sunResolved that @todo
Comment #9
sunum, slightly strange structure expected in that hook. Manually tested attached patch, works.
Speaking of tests, do we want/need to test this? Hm. Let's defer that to #674692: Node module integration tests, so RTBC.
Comment #10
sunAs for the caching issue, see #870292: hook_field_extra_fields() results should be cached by language
Comment #11
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks!
Comment #12
sunblargh. :) #775444: API implementor documentation just made me recall and revisit this patch again.
The code now assumes that every form that registers an 'entity' is a Field API entity.
That's not necessarily the case -- it may be true for all core entities, but technically, contributed and custom modules could register forms to protect by Mollom that are neither using entity API nor field API.
We can keep this issue fixed until someone actually reports a problem about this.
Powered by Dreditor.
Comment #13
Dries CreditAttribution: Dries commentedUmph, but I agree that it is acceptable for now. Might be worthy a code comment ... ?
Comment #14
sunRight. Defering tests to #674692: Node module integration tests
Comment #15
Dries CreditAttribution: Dries commentedThanks for the documentation. Committed to CVS HEAD.