Image does not show in image_captcha when using random_captcha_type

iva2k - April 12, 2009 - 19:03
Project:CAPTCHA Pack
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

Image does not show when image_captcha is invoked by random_captcha.

Problem page source has:

...
<img src="/image_captcha/%252F1239559457" alt="Image CAPTCHA" title="Image CAPTCHA" />...

when not using random captcha, working page source has:

...
<img src="/image_captcha/59/1239555676" alt="Image CAPTCHA" title="Image CAPTCHA" />...

#1

iva2k - April 12, 2009 - 19:05

Inspecting the code of image captcha, I noticed that hook captcha uses 3 arguments:
function image_captcha_captcha($op, $captcha_type='', $arg3='') {...

Looking into random captcha code it is obvious that it does not pass the 3rd argument:
function random_captcha_type_captcha($op, $captcha_type='') {...

... which explains the broken page source and missing image.

#2

iva2k - April 12, 2009 - 19:08

It appears that random captcha depends on captcha API changes very much. Given that, I think that random captcha should belong to the base captcha module, instead of the captcha pack module. It will allow updating them at the same time. What do you think?

#3

iva2k - April 12, 2009 - 19:49

I submitted a patch that resolves this issue here http://drupal.org/node/393592#comment-1467354.

#4

soxofaan - April 13, 2009 - 13:03
Project:CAPTCHA» CAPTCHA Pack
Version:6.x-2.x-dev» 6.x-1.x-dev
Status:active» fixed

fixed by
http://drupal.org/cvs?commit=196182
thanks for figuring this out

#5

System Message - April 27, 2009 - 13:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#6

iva2k - August 10, 2009 - 05:43
Priority:normal» critical
Status:closed» active

Regression by commit #214786

Image Captcha does not show again with latest code:
CAPTCHA Pack 6.x-1.x-dev (2009-Jul-24)
CAPTCHA 6.x-2.x-dev (2009-Jul-17)

Symptoms are exactly the same as in the originating post.

Line 38 should be returned to:

function random_captcha_type_captcha($op, $captcha_type='', $arg3='') {

Line 62 should be returned to:

$captcha = module_invoke($module, 'captcha', 'generate', $type, $arg3);

Restoring $arg3 passing to the way it was fixes the image captcha display.

#7

soxofaan - August 18, 2009 - 23:28
Status:active» fixed

fixed thanks
http://drupal.org/cvs?commit=252972

#8

System Message - September 1, 2009 - 23:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.