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" />...

Comments

iva2k’s picture

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.

iva2k’s picture

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?

iva2k’s picture

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

soxofaan’s picture

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

Status:Fixed» Closed (fixed)

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

iva2k’s picture

Priority:Normal» Critical
Status:Closed (fixed)» 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.

soxofaan’s picture

Status:Active» Fixed

Status:Fixed» Closed (fixed)

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