Closed (fixed)
Project:
CAPTCHA
Version:
6.x-2.x-dev
Component:
Text Captcha (text_captcha)
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 Dec 2007 at 00:24 UTC
Updated:
18 Jan 2008 at 14:33 UTC
Jump to comment: Most recent file
Comments
Comment #1
webchickI don't currently have a chance to give a proper review, but one thing I note right away is that hook_menu and hook_init are not the same thing. Check the hook_menus on some of the core modules to get an idea of how the code in here should change.
Also, the patch doesn't apply for me. How are you generating it? http://drupal.org/patch/create has some good instructions, including a video showing how this is done. But if you need further help, please ping back here or come find us in #drupal-ghop on irc.freenode.net. :)
Comment #2
webchickComment #3
binodc commentedI used winmerge(http://drupal.org/node/75805) to make the patch.
i hv attached the 2 modified files .
i hv corrected the hook_menu .
I am getting some error at /admin/user/captcha/text_captcha
Could some one suggest a way to correct it!
Comment #4
robloachThe warning you're getting might have something to do with the base CAPTCHA module. The module looks pretty good! Now all we need is that patch! If you're using WinMerge, I assume you're on a Windows machine. I strongly suggest you try out TortoiseCVS as it provides a very clean way to check out sources, use your favourite programs to make changes, and then create a patch of all the changes. Good luck! Great work!
Comment #5
binodc commentedCurrently i do not have cvs account and does not know how to use it properly.
what should i do to rectify the CAPTCHA module errors??
Comment #6
robloachTest the reCAPTCHA module and see if you get the same warning. I've seen similar issues pop up with it. If you follow the TortoiseCVS instructions, you should be fine.
Comment #7
binodc commentedWith reCAPTCHA module i am not getting any error.
Now i understood how to use the CVS system. Thanks.I have attached the new patch.
I think the errors are due to CAPTCHA module check /admin/user/captcha/captcha/examples/captcha/Math or /Text
Also the error logs are reported but message does not come in the error report!
Comment #8
robloachVery nice work! It's getting there..... Couple things:
'callback arguments'should be'page arguments'.... This will help ;-) .return $output;causes a warning: notice: Undefined variable: output in captcha\text_captcha\text_captcha.module on line 21..... Removing that line should fix it!Comment #9
webchickOne more...
That stuff should be removed from the .info file. The packaging script (the thing that bundles up the module .tar.gz files) adds that automatically.
Comment #10
binodc commentedpatch update
Still error at http://localhost/test2/admin/user/captcha/captcha/examples/captcha/Math
warning: Missing argument 3 for drupal_process_form(), called in C:\wamp\www\test2\sites\default\modules\captcha\captcha.module on line 690 and defined in C:\wamp\www\test2\includes\form.inc on line 365.
Comment #11
binodc commentedPatch Update
I think it is done.
Please review
Comment #12
add1sun commentedbinodc, sorry this is taking so long for us to review. :-(
Just two really small things:
1) The package info added by the packaging script in the .info file needs to be removed:
2) The array items in the hook_menu need to be outdented (as in, they are currently too far indented.) The comment and
'title' => 'Text CAPTCHA',and friends should all be at a two space indent under $items.I ran it through functionality and everything worked great! Just fix those two things and load another patch and it is RTBC.
Comment #13
binodc commentedThanks for reviewing add1sum.
I have done the 2 fixes .& its ready to be committed.
Pls review fast
Comment #14
soxofaan commentedThe validation of the settings form still has some issues:
the validate function is not fired (I can submit out of range data), see http://drupal.org/node/144132#base
the siganture of the validate function also isn't right: it should be foo_validate($form, &$form_state), see http://drupal.org/node/144132#process-params
Comment #15
binodc commentedI could not figure out the problem.
could some one help me with some suggestions??
Sorry for the delay.
I am currently in a remote part of India and connecting Net via Gprs(slow than dialup).
Pls allow me some extra time to respond.
Comment #16
soxofaan commentedIf the admin enables user defined words, he should enter at least 20 words in the text area. In your current version (patch from #13) it is however possible to enter less words without error message.
It is also possible to set "Number of words in phrase" outside the range of possible values (4 to 10) without error message.
Comment #17
robloachYou're so close.....
$form['#validate'][] ='text_captcha_settings_form_validate';infunction text_captcha_settings_form(I miss this all the time)$form_values = $form_state['values'];might help you intext_captcha_settings_form_validate, as you're using the $form_values function a lot.If you fix those three things doing some debugging with Devel's dvm function, you should be good! Keep it up! You're so close.
Another thing to watch out for is the Windows line breaks. Drupal CVS standard uses UNIX line breaks. You can fix those using a good text editing program like PSPad.
Comment #18
aclight commentedI'm sorry, but this has been ActionNeeded for 6 days now and we have not heard from the student during that time. I know you're really close to finishing this up, so if you are still interested please re-claim this task (if it's still open) so you can finish it up and get credit for the work you've done so far.
Comment #19
Smartys-1 commentedI just claimed this task on the Google issue tracker. I'm attaching my patch, which is based off of binodc's patch and which hopefully addresses the issues raised here. However, as people have pointed out, binodc's patch was just about complete before the task was reopened. This leads to the question of whether this task is still suitable for earning credit (since my work involved addressing the few issues raised here and then indenting some code properly based on my changes).
In any case, here is my patch.
Comment #20
soxofaan commentedThe patch from #19 looks ok to me.
One minor thing is to put an extra space after the '=' in
but that's not a show stopper.
If you want to do more work on it, you could separate off the administration page functions to a separate include file 'text_captcha.admin.inc' as explained in http://drupal.org/node/146172 .
Additionally you could also separate off the CAPTCHA generating functions (_text_captcha_generate_nonsense_word(), _text_captcha_generate_words(), _text_captcha_ordinal()) to for example 'text_captcha.user.inc', and only load (require_once) this include file in the 'generate' part of text_captcha_captcha().
This will make your work more credit-worthy ;)
PS: look under "Adding/Deleting files" of http://drupal.org/patch/create for more information on how to create a patch that adds files
Comment #21
Smartys-1 commentedAlright, fair enough :)
Here's a patch with the changes, I hope I did them correctly. :P
Comment #22
soxofaan commentedThat was fast!
patch looks very good
I did some final tweaks (added "$Id$" CVS keywords to new files)
and committed it: http://drupal.org/cvs?commit=94082
thanks a lot
Comment #23
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.