Hi. I'm not sure if this is the right place to do this but I'll give it a try. In the past few days I've been developing a patch to integrate mollom module with simplenews subscription block form following the API instructions, with no success. I successfully managed to get mollom module to take simplenews block forms in account (admin), but after I configure them it still doesn't show the captcha image or any other kind of verification and simply allows the form to be submitted without any kind of protection.
I don't know if there's someone currently working on this feature, but even if there's not I'd like to get some guidance regarding this feature in order to complete my patch.
So far I included simplenews_mollom_form_list()
, simplenews_mollom_form_info()
and simplenews_mollom_form_info_alter()
functions. I even read the test function code included in mollom module to try to figure out what I'm missing, but my only guessing is that it fails because I'm dealing with a block form and not a "normal" form per se.
Thanks in advance for any information and/or help you can give me in this matter!
Comment | File | Size | Author |
---|---|---|---|
#13 | 1874072-simplenews-12.patch | 1.02 KB | Lukas von Blarer |
Comments
Comment #1
wheck CreditAttribution: wheck commentedHi again! Well it turned out that the problem was that the form id of the block was saved using hyphen instead of underscores into the db, and that's why mollom module couldn't find it!! After fixing that, it took me a while to figure out I had to empty mollom module's cache, but at the end I did and the captcha image was finally rendered into the block :D. Now the problem is that when I submit the form, it gives me
Call to undefined function simplenews_block_form_validate()
, and when I print$form
and$form_state
it shows nothing. From all the code reading I've done so far, I got that mollom module works for node-based forms, but if I'm putting all the information required in my block form it should work, right? Seriously isn't there anyone who can help me?Comment #2
miccelito CreditAttribution: miccelito commentedIf you wanna add some spam protection to simplenews input.form-text field (for anonymous users) you could use Botcha http://drupal.org/project/botcha. It lets you add the form id as you describe above
Comment #3
sunIsn't Simplenews based on nodes?
All node types can be protected by Mollom already.
Comment #4
wheck CreditAttribution: wheck commentedHi! Something happened and I failed to get email notification of your answers, sorry about that. I was trying to add mollom support to a simplenews block form, not to a node per se. When I tried to do so, the blocks I hade on my site didn't even show up in mollom's settings page.
Regarding miccelito's comment, I'll definitely give botcha a try! thanks :D!
Comment #5
wheck CreditAttribution: wheck commentedDefinitely didn't make it. I added the form id and saved it, but the captcha doesn't show. I'm still checking botcha settings hoping I missed something, but I'm starting to think you just can't protect forms contained in blocks. Nevertheless I'm still not giving up since in botcha's default settings, user block form appears listed as protected, so there may still be hope for those poor block-embbeded forms!
Comment #6
wheck CreditAttribution: wheck commentedNeh, I'm giving up on this, any new ideas are totally welcomed, I'm feeling really frustrated here...
Comment #7
miccelito CreditAttribution: miccelito commentedInstall Botcha https://drupal.org/project/botcha i.e Botcha 7.x-3.2.
Enable the module.
Go to admin/config/people/botcha/form.
Click 'Add BOTCHA protection to form' link.
Add the simplenews block form id (would be something like 'simplenews_block_form_**' where ** is the number rendered for the current simplenews block).
Your block should now be protected.
Comment #8
sunUnfortunately, it's unclear what questions are unresolved here. The last stated error was:
However, that is not relevant to the Mollom integration. The error message indicates that the form constructor registered a form validation callback
simplenews_block_form_validate()
, but in the request that actually invokes the form validation, the function is not loaded and thus unknown to the system.Most often, this is caused by form constructors that are dynamically loading additional code from other PHP include files, whereas the form constructor function is not necessarily re-executed when a form is validated. In turn, the form validation callback function is registered, but not loaded.
Comment #9
lionheart8 CreditAttribution: lionheart8 commentedI am using simplenews, I am not a coder ... have always used mollom, which has always faithfully blocked submissions, including a recent onslaught of 0ver 24000 attempted submissions on a single day, for what is apparently a small site.
I would very much want to include simplenews forms, but none appears on the form addition page.
Could you please consider adding it to the forms it protects? I am sure many folks would profit from this as simplenews is widely used.
Thank you ...
Comment #10
Jochen Wendebaum CreditAttribution: Jochen Wendebaum commentedIt is necessary for mollom to also work on forms in blocks, as the simplenews subscribe block.
Is this in the roadmap?
Comment #11
caicedo CreditAttribution: caicedo commentedSimplenews uses either a block of a form to allow people to subscribe. For some reason the form does not appear in the list of forms that Mollom can protect. I think having protection on the block would be nice. Adding the subscription form to the list that Molom identifies is at least a first step.
Comment #12
Lukas von BlarerThis does the trick for the multisubscription form. Adding support for the per newsletter category forms is not hard..
Comment #13
Lukas von BlarerWell, actually I could provide a patch for this directly :)
Comment #16
eshta CreditAttribution: eshta commentedThe last test failure was due to an unrelated issue. I've just submitted this for re-test.
Comment #17
eshta CreditAttribution: eshta commentedI know some time has passed here. It seems to me that the Mollom hooks really belong within the simplenews module. That way as things change on how the content is structured, they can be appropriately updated. I have taken the patch that was submitted here and used it to create a new issue in their queue. I'm happy to help as far as advising how to use the API and I'm set as a watcher on the ticket.
https://www.drupal.org/node/2371353