adding recaptcha form to module

dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Fri, 2010-08-20 18:12

I'm trying to add a recaptcha to the ecard module. I can see how the comments module does it (by firing the comment_add_form event, for which the recaptcha_event listens). Without making changes to recaptcha_event, how can I extend it within the ecard module to include a recaptcha form? Would I have to create modules/ecard/modules/recaptcha/recaptcha_event.php and add in the listener?

--
For PHPNuke, phpBB2, and phpBB3 integration help, please visit NukedGallery.net.
[img]http://www.nukedgallery.net/signature.jpg[/img]

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sat, 2010-08-21 17:57

We don't have a great system for this yet. Choices:
1) Overload recaptcha_event with your own MY_recaptcha_event (look in modules/gallery/helpers for other overloads; check Kohana docs for the cascading filesystem and overloads)

2) Edit recaptcha_event directly and we'll check that into core

3) File a ticket. We need to come up with a more flexible architecture
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Sun, 2010-08-22 00:43

I'm going to do 1 and 3. I'm -1 on #2 simply because it would force module developers in the future to similarly edit a core file.

--
For PHPNuke, phpBB2, and phpBB3 integration help, please visit NukedGallery.net.
[img]http://www.nukedgallery.net/signature.jpg[/img]

 
dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Sun, 2010-08-22 01:21

bharat-
Ticket created (1306, i think).

I also added an overload to recaptcha_event to the eCard module. One thing that I notice now, however, is that if the form is missing fields, none of the error messages appear, regardless of whether the recaptcha is good or not. I've committed it to my fork if you want to take a look. I haven't bumped the version number since I don't want to update that until this is worked out.

--
For PHPNuke, phpBB2, and phpBB3 integration help, please visit NukedGallery.net.
[img]http://www.nukedgallery.net/signature.jpg[/img]

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2010-08-22 19:23

I made this a blocker for 3.0 -- we should work this out before we ship. I have some ideas on how to do it cleanly.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sun, 2010-08-22 20:03

Ok, I've fixed this in http://bit.ly/cUWCBO and updated the card module in http://bit.ly/cinpw7

Pull this change back before you change your code. Also, I noticed that your commits to your contrib fork have windows style line endings-- you might want to fix that up in the future.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git