A user filed this issue #1596666: Implement hook_mollom_form_info for submission protection by Mollom with 1 of my modules to implement hook_mollom_form_info for a particular fieldable entity.
To do this I realized I would have to copy some code from mollom.module
I will attach a patch that adds the function "mollom_add_entity_form_info" for now if just adds field info and entity_id for post_id.
I have changed node_mollom_form_info and comment_mollom_form_info to use this functions. So this adds Field API support for comments.
The idea is that any module that implements hook_mollom_form_info for a fieldable entity would use the function mollom_add_entity_form_info. This way if mollom added support for other field types than the current 'text', 'text_long', 'text_with_summary' types then each module would not have to update their code.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | mollom.entity-fields.7.patch | 4.91 KB | sun |
| #6 | mollom.entity-fields.6.patch | 3.34 KB | tedbow |
| #5 | mollom.entity-fields.5.patch | 2.4 KB | sun |
| #3 | mollom-add_field_entity_function-1597504-3.patch | 53.86 KB | tedbow |
| #1 | mollom-add_field_entity_function-1597504-1.patch | 2.6 KB | tedbow |
Comments
Comment #1
tedbowattaching patch
Comment #3
tedbowThe last patch got rejected b/c of "Ensure the patch only contains unix-style line endings."
Could there have been existing non-unix line endings in the file? I haven't got this message before and I am working in Linux.
Anyways ran dos2unix which replaced a bunch of line endings.
Comment #4
tedbowComment #5
sunwow. Lovely patch!
Though: I'm not sure how you managed to do it, if you're really on Linux, but your patch indeed contained a CRLF in the added/new lines of your patch in #1. All the other changes in #3 are different indentations.
Thus, re-rolled #1 without that CRLF, and some minor changes.
Comment #6
tedbowThanks!
Indeed I am
So users are also fieldable entities so....
Should we add this function to user_register_form - since you can have text fields on the User object? Maybe if no one has asked for it, it's not worth it.
Also node_profile_form, because it could have fields.
I have attached a patch with these changes if you think it makes sense.
Comment #7
sunThanks for reporting, reviewing, and testing! Committed attached patch to 7.x-2.x.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.